mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 09:37:03 +02:00
Logging
This commit is contained in:
parent
00d475f3a6
commit
73b2bf6a25
4 changed files with 70 additions and 26 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue