Commits

Anonymous committed a0602f8

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

Comments (0)

Files changed (1)

lodgeit/models.py

         )).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):