More code cleanup

This commit is contained in:
zandercymatics 2023-08-25 08:43:47 -06:00
parent 3d0a519ab0
commit 81e5f5f8bb
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 11 additions and 21 deletions

View file

@ -167,16 +167,14 @@ class DomainAdmin(ListHeaderAdmin):
request.session["analyst_action"] = "edit"
# Restricts this action to this domain (pk) only
request.session["analyst_action_location"] = obj.id
return HttpResponseRedirect(reverse("domain", args=(obj.id,)))
return super().response_change(request, obj)
def change_view(self, request, object_id):
# If the analyst was recently editing
# If the analyst was recently editing a domain page,
# delete any associated session values
if "analyst_action" in request.session:
# delete the session variable
del request.session["analyst_action"]
# delete the associated location
del request.session["analyst_action_location"]
return super().change_view(request, object_id)