Skip to content

Commit

Permalink
adding a filter and update method instead of save for tags merge
Browse files Browse the repository at this point in the history
  • Loading branch information
guel-codes committed Jul 15, 2024
1 parent b992366 commit f54d8c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions taggit/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def merge_tags_view(self, request):
tagged_items = TaggedItem.objects.filter(tag=tag)
for tagged_item in tagged_items:
tagged_item.tag = new_tag
tagged_item.save()
# tag.delete() #this will delete the selected tags after merge
TaggedItem.objects.filter(tag=tag).update(tag=new_tag)
# tag.delete() #this will delete the selected tags after merge...leaving out for now

self.message_user(request, "Tags have been merged")
# clear the selected_tag_ids from session after merge is complete
Expand Down

0 comments on commit f54d8c9

Please sign in to comment.