mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-14 05:29:43 +02:00
PR cleanup
This commit is contained in:
parent
bd143af6f1
commit
cde0d527ce
6 changed files with 8 additions and 11 deletions
|
@ -66,7 +66,6 @@ def portfolio_permissions(request):
|
||||||
"has_base_portfolio_permission": False,
|
"has_base_portfolio_permission": False,
|
||||||
"has_domains_portfolio_permission": False,
|
"has_domains_portfolio_permission": False,
|
||||||
"has_domain_requests_portfolio_permission": False,
|
"has_domain_requests_portfolio_permission": False,
|
||||||
"has_edit_org_portfolio_permission": False,
|
|
||||||
"portfolio": None,
|
"portfolio": None,
|
||||||
"has_organization_feature_flag": False,
|
"has_organization_feature_flag": False,
|
||||||
}
|
}
|
||||||
|
@ -74,7 +73,6 @@ def portfolio_permissions(request):
|
||||||
"has_base_portfolio_permission": request.user.has_base_portfolio_permission(),
|
"has_base_portfolio_permission": request.user.has_base_portfolio_permission(),
|
||||||
"has_domains_portfolio_permission": request.user.has_domains_portfolio_permission(),
|
"has_domains_portfolio_permission": request.user.has_domains_portfolio_permission(),
|
||||||
"has_domain_requests_portfolio_permission": request.user.has_domain_requests_portfolio_permission(),
|
"has_domain_requests_portfolio_permission": request.user.has_domain_requests_portfolio_permission(),
|
||||||
"has_edit_org_portfolio_permission": request.user.has_edit_org_portfolio_permission(),
|
|
||||||
"portfolio": request.user.portfolio,
|
"portfolio": request.user.portfolio,
|
||||||
"has_organization_feature_flag": True,
|
"has_organization_feature_flag": True,
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,8 +170,6 @@ class DomainSuborganizationForm(forms.ModelForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
# Get the incoming request object
|
|
||||||
self.request = kwargs.pop("request", None)
|
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
portfolio = self.instance.portfolio if self.instance else None
|
portfolio = self.instance.portfolio if self.instance else None
|
||||||
|
|
|
@ -27,7 +27,6 @@ class UserPortfolioPermissionChoices(models.TextChoices):
|
||||||
VIEW_PORTFOLIO = "view_portfolio", "View organization"
|
VIEW_PORTFOLIO = "view_portfolio", "View organization"
|
||||||
EDIT_PORTFOLIO = "edit_portfolio", "Edit organization"
|
EDIT_PORTFOLIO = "edit_portfolio", "Edit organization"
|
||||||
|
|
||||||
# TODO - think of other solutions
|
|
||||||
# Domain: field specific permissions
|
# Domain: field specific permissions
|
||||||
VIEW_SUBORGANIZATION = "view_suborganization", "View suborganization"
|
VIEW_SUBORGANIZATION = "view_suborganization", "View suborganization"
|
||||||
EDIT_SUBORGANIZATION = "edit_suborganization", "Edit suborganization"
|
EDIT_SUBORGANIZATION = "edit_suborganization", "Edit suborganization"
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
{% comment %}
|
||||||
|
This is a custom widget for USWDS's comboboxes.
|
||||||
|
USWDS comboboxes are basically just selects with a "usa-combo-box" div wrapper.
|
||||||
|
We can further customize these by applying attributes to this parent element,
|
||||||
|
for now we just carry the attribute to both the parent element and the select.
|
||||||
|
{% endcomment %}
|
||||||
|
|
||||||
<div class="usa-combo-box"
|
<div class="usa-combo-box"
|
||||||
{% for name, value in widget.attrs.items %}
|
{% for name, value in widget.attrs.items %}
|
||||||
{{ name }}="{{ value }}"
|
{{ name }}="{{ value }}"
|
||||||
|
|
|
@ -245,7 +245,6 @@ class DomainSubOrganizationView(DomainFormBaseView):
|
||||||
"""Add domain_info.organization_name instance to make a bound form."""
|
"""Add domain_info.organization_name instance to make a bound form."""
|
||||||
form_kwargs = super().get_form_kwargs(*args, **kwargs)
|
form_kwargs = super().get_form_kwargs(*args, **kwargs)
|
||||||
form_kwargs["instance"] = self.object.domain_info
|
form_kwargs["instance"] = self.object.domain_info
|
||||||
form_kwargs["request"] = self.request
|
|
||||||
return form_kwargs
|
return form_kwargs
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
|
@ -273,9 +272,7 @@ class DomainSeniorOfficialView(DomainFormBaseView):
|
||||||
def get_form_kwargs(self, *args, **kwargs):
|
def get_form_kwargs(self, *args, **kwargs):
|
||||||
"""Add domain_info.senior_official instance to make a bound form."""
|
"""Add domain_info.senior_official instance to make a bound form."""
|
||||||
form_kwargs = super().get_form_kwargs(*args, **kwargs)
|
form_kwargs = super().get_form_kwargs(*args, **kwargs)
|
||||||
org_user = self.request.user.is_org_user(self.request)
|
if self.request.user.is_org_user(self.request):
|
||||||
|
|
||||||
if org_user:
|
|
||||||
portfolio = Portfolio.objects.filter(information_portfolio=self.object.domain_info).first()
|
portfolio = Portfolio.objects.filter(information_portfolio=self.object.domain_info).first()
|
||||||
senior_official = portfolio.senior_official if portfolio else None
|
senior_official = portfolio.senior_official if portfolio else None
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -30,10 +30,8 @@ class PortfolioDomainRequestsView(PortfolioDomainRequestsPermissionView, View):
|
||||||
template_name = "portfolio_requests.html"
|
template_name = "portfolio_requests.html"
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
|
|
||||||
if self.request.user.is_authenticated:
|
if self.request.user.is_authenticated:
|
||||||
request.session["new_request"] = True
|
request.session["new_request"] = True
|
||||||
|
|
||||||
return render(request, "portfolio_requests.html")
|
return render(request, "portfolio_requests.html")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue