Skip to content

Commit

Permalink
Merge pull request #6377 from akatsoulas/tags-cache
Browse files Browse the repository at this point in the history
Clear tag cache after adding new
  • Loading branch information
akatsoulas authored Nov 26, 2024
2 parents 812e80d + 8fe4520 commit 4ec35b0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kitsune/questions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,7 @@ def add_tag_async(request, question_id):
if request.content_type == "application/json":
tag_ids = json.loads(request.body).get("tags", [])
question, tags = _add_tag(request, question_id, tag_ids)
question.clear_cached_tags()
if not tags:
return JsonResponse({"error": "Some tags do not exist or are invalid"}, status=400)
return JsonResponse({"message": "Tags updated successfully.", "data": {"tags": tags}})
Expand Down

0 comments on commit 4ec35b0

Please sign in to comment.