Procházet zdrojové kódy

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

Dimitri Korsch před 3 roky
rodič
revize
2d73e0e5b6
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  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()