applications: delete my_library cache on renewal
whether the renewal was allowed or not; that way the editor sees the
result message in my_library either way
@@ -1374,6 +1374,11 @@ class RenewApplicationView(SelfOnly, ToURequired, DataProcessingRequired, FormVi
]
renewal = application.renew()
+
+ # Requesting Renewing invalidates the my_library cache
+ # This happens regardless of sucess so that the message will be displayed
+ self.request.user.userprofile.delete_my_library_cache()
+
if not renewal:
messages.add_message(
self.request,
@@ -1394,7 +1399,4 @@ class RenewApplicationView(SelfOnly, ToURequired, DataProcessingRequired, FormVi
# fmt: on
)
- # Renewing an application invalidates the my_library cache
- self.request.user.userprofile.delete_my_library_cache()
-
return HttpResponseRedirect(return_url)
