This commit is contained in:
zandercymatics 2023-08-22 12:45:36 -06:00
parent 00d475f3a6
commit 73b2bf6a25
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
4 changed files with 70 additions and 26 deletions

View file

@ -145,7 +145,6 @@ class DomainAdmin(ListHeaderAdmin):
PLACE_HOLD = "_place_client_hold"
EDIT_DOMAIN = "_edit_domain"
if PLACE_HOLD in request.POST:
logger.debug("Hit!")
try:
obj.place_client_hold()
except Exception as err:
@ -163,6 +162,9 @@ class DomainAdmin(ListHeaderAdmin):
elif EDIT_DOMAIN in request.POST:
# We want to know, globally, when an edit action occurs
request.session['analyst_action'] = 'edit'
# Restricts this action to this domain only
request.session['analyst_action_location'] = obj.id
return HttpResponseRedirect(reverse('domain', args=(obj.id,)))
return super().response_change(request, obj)
# Sets domain_id as a context var
@ -171,6 +173,9 @@ class DomainAdmin(ListHeaderAdmin):
# If an analyst performed an edit action,
# delete the session variable
del request.session['analyst_action']
# delete the associated location
del request.session['analyst_action_location']
extra_context = extra_context or {}
extra_context["domain_id"] = object_id
return super().change_view(