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

master
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
1 changed files with 2 additions and 1 deletions

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)