Tag deleting

This commit is contained in:
dave 2018-09-22 15:12:35 -07:00
parent 8fec641e66
commit 346f0a7944

View File

@ -336,8 +336,13 @@ class TagView(object):
tag.is_album = 0
elif op == "Promote to album":
tag.is_album = 1
elif op == "Delete tag":
s.query(TagItem).filter(TagItem.tag_id == tag.id).delete()
s.delete(tag)
s.commit()
raise cherrypy.HTTPRedirect('/', 302)
else:
raise Exception("Invalid op")
raise Exception("Invalid op: '{}'".format(op))
s.commit()
raise cherrypy.HTTPRedirect('/tag/{}'.format(tag.uuid), 302)