mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-05 17:28:31 +02:00
Store in a form instead
This commit is contained in:
parent
d645c2fbaa
commit
0413dbcbb4
2 changed files with 2 additions and 18 deletions
|
@ -46,12 +46,7 @@
|
|||
{% include "includes/summary_item.html" with title='Your contact information' value=request.user.contact contact='true' edit_link=url %}
|
||||
|
||||
{% url 'domain-security-email' pk=domain.id as url %}
|
||||
{% if security_email is not None and security_email != "dotgov@cisa.dhs.gov"%}
|
||||
{% include "includes/summary_item.html" with title='Security email' value=security_email edit_link=url %}
|
||||
{% else %}
|
||||
{% include "includes/summary_item.html" with title='Security email' value=None edit_link=url %}
|
||||
{% endif %}
|
||||
|
||||
{% include "includes/summary_item.html" with title='Security email' value=form.security_email.value edit_link=url %}
|
||||
|
||||
{% url 'domain-users' pk=domain.id as url %}
|
||||
{% include "includes/summary_item.html" with title='User management' users='true' list=True value=domain.permissions.all edit_link=url %}
|
||||
|
|
|
@ -29,20 +29,9 @@ class DomainPermissionView(DomainPermission, DetailView, abc.ABC):
|
|||
# variable name in template context for the model object
|
||||
context_object_name = "domain"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.security_email = None
|
||||
|
||||
def get_object(self, queryset=None):
|
||||
obj = super().get_object(queryset)
|
||||
self.security_email = obj.get_security_email()
|
||||
return obj
|
||||
|
||||
# Adds context information for user permissions
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
# Store the security email
|
||||
context["security_email"] = self.security_email
|
||||
# Adds context information for user permissions
|
||||
user = self.request.user
|
||||
context["is_analyst_or_superuser"] = user.is_staff or user.is_superuser
|
||||
# Stored in a variable for the linter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue