1. Christopher Grebs
  2. lodgeit-main

Commits

Christopher Grebs  committed a0602f8

hotfix to not give a sql warning if the IN-predicate was empty

  • Participants
  • Parent commits b1c74de
  • Branches lodgeit

Comments (0)

Files changed (1)

File lodgeit/models.py

View file
  • Ignore whitespace
         )).order_by(Paste.paste_id.desc()).all()
 
         to_mark = [p.paste_id for p in paste_list]
-        Paste.query.filter(Paste.paste_id.in_(to_mark)) \
-                   .update(values={'handled': True})
-        db.session.commit()
+        if to_mark:
+            Paste.query.filter(Paste.paste_id.in_(to_mark)) \
+                       .update(values={'handled': True})
+            db.session.commit()
         return paste_list
 
     def _get_private(self):