mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 09:37:03 +02:00
started adding the security info
This commit is contained in:
parent
b7587758a3
commit
d3bc00fdce
5 changed files with 337 additions and 86 deletions
|
@ -125,6 +125,8 @@ class DomainAdmin(ListHeaderAdmin):
|
|||
|
||||
def response_change(self, request, obj):
|
||||
ACTION_BUTTON = "_place_client_hold"
|
||||
GET_SECURITY_EMAIL="_get_security_contact"
|
||||
SET_SECURITY_EMAIL="_set_security_contact"
|
||||
if ACTION_BUTTON in request.POST:
|
||||
try:
|
||||
obj.place_client_hold()
|
||||
|
@ -140,6 +142,43 @@ class DomainAdmin(ListHeaderAdmin):
|
|||
% obj.name,
|
||||
)
|
||||
return HttpResponseRedirect(".")
|
||||
|
||||
if GET_SECURITY_EMAIL in request.POST:
|
||||
try:
|
||||
security_email=obj.get_security_email()
|
||||
|
||||
|
||||
except Exception as err:
|
||||
self.message_user(request, err, messages.ERROR)
|
||||
else:
|
||||
self.message_user(request,
|
||||
(
|
||||
"The security email is %"
|
||||
". Thanks!"
|
||||
)
|
||||
% security_email,
|
||||
)
|
||||
return HttpResponseRedirect(".")
|
||||
|
||||
return super().response_change(request, obj)
|
||||
def response_change(self, request, obj):
|
||||
ACTION_BUTTON = "_get_security_email"
|
||||
|
||||
if ACTION_BUTTON in request.POST:
|
||||
try:
|
||||
obj.security
|
||||
except Exception as err:
|
||||
self.message_user(request, err, messages.ERROR)
|
||||
else:
|
||||
self.message_user(
|
||||
request,
|
||||
(
|
||||
"%s is in client hold. This domain is no longer accessible on"
|
||||
" the public internet."
|
||||
)
|
||||
% obj.name,
|
||||
)
|
||||
return HttpResponseRedirect(".")
|
||||
|
||||
return super().response_change(request, obj)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue