Browse Source

fixed a bug in the query of next and previous files in a collection

Dimitri Korsch 3 years ago
parent
commit
2d73e0e5b6
1 changed files with 2 additions and 2 deletions
  1. 2 2
      pycs/database/File.py

+ 2 - 2
pycs/database/File.py

@@ -122,7 +122,7 @@ class File(NamedBaseModel):
 
         :return: another file or None
         """
-        return self._get_another_file(File.id > self.id, Collection.id == self.collection_id)\
+        return self._get_another_file(File.id > self.id, File.collection_id == self.collection_id)\
             .order_by(File.id).first()
 
 
@@ -132,7 +132,7 @@ class File(NamedBaseModel):
 
         :return: another file or None
         """
-        return self._get_another_file(File.id < self.id, Collection.id == self.collection_id)\
+        return self._get_another_file(File.id < self.id, File.collection_id == self.collection_id)\
             .order_by(File.id.desc()).first()