Let Photo.remove_tag only remove exact tag, not children.

I wrote this because I felt it would be a useful shorthand, as a way
of nuking all tags of a subtree off a photo, but it's too easy
to cause collateral damage when composing remove_tag with other
functions. So, when you remove tags from a photo, you'll have to be
more specific.
master
voussoir 2020-09-14 05:37:13 -07:00
parent 2dc1603d5e
commit 85f24dd1f5
1 changed files with 2 additions and 5 deletions

View File

@ -1025,9 +1025,6 @@ class Photo(ObjectBase):
tag = self.photodb.get_tag(name=tag)
self.photodb.log.debug('Removing %s from %s', tag, self)
tags = list(tag.walk_children())
for tag in tags:
pairs = {'photoid': self.id, 'tagid': tag.id}
self.photodb.sql_delete(table='photo_tag_rel', pairs=pairs)