Explorar el Código

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

Dimitri Korsch hace 3 años
padre
commit
2d73e0e5b6
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  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()