Urgent fix for photo.remove_tags didn't check photoid==self.id.

This commit is contained in:
voussoir 2021-03-03 13:31:58 -08:00
parent cc79a4945d
commit 86199d05ef
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -1267,7 +1267,8 @@ class Photo(ObjectBase):
self.photodb.log.info('Removing %s from %s.', tags, self)
query = f'''
DELETE FROM photo_tag_rel
WHERE tagid IN {sqlhelpers.listify(tag.id for tag in tags)}
WHERE photoid == "{self.id}"
AND tagid IN {sqlhelpers.listify(tag.id for tag in tags)}
'''
self.photodb.sql_execute(query)