Skip to content

Commit

Permalink
refactor: Clear cache for detail_company_id_user_id in BouncedEmailAPI
Browse files Browse the repository at this point in the history
The cache for the `detail_company_id_user_id` key is now cleared in the `BouncedEmailAPI` view. This change ensures that the cache is updated after processing a bounced email, preventing any stale data from being displayed. It improves the accuracy and reliability of the application.
  • Loading branch information
QA2A committed Sep 5, 2024
1 parent 4f328e7 commit 4ea6db3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ def post(self, request, *args, **kwargs):
company = application.company
company.email = ""
company.save()
# clear the detail_ cache key
cache_key = f'detail_{company.id}_user_{request.user.id}'
cache.delete(cache_key)

return Response(
{"detail": "Bounced email processed successfully."},
Expand Down

0 comments on commit 4ea6db3

Please sign in to comment.