6
0
Эх сурвалжийг харах

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

Dimitri Korsch 3 жил өмнө
parent
commit
2d73e0e5b6

+ 2 - 2
pycs/database/File.py

@@ -122,7 +122,7 @@ class File(NamedBaseModel):
 
 
         :return: another file or None
         :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()
             .order_by(File.id).first()
 
 
 
 
@@ -132,7 +132,7 @@ class File(NamedBaseModel):
 
 
         :return: another file or None
         :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()
             .order_by(File.id.desc()).first()