PR cleanup

This commit is contained in:
zandercymatics 2024-08-05 12:59:44 -06:00
parent bd143af6f1
commit cde0d527ce
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
6 changed files with 8 additions and 11 deletions

View file

@ -66,7 +66,6 @@ def portfolio_permissions(request):
"has_base_portfolio_permission": False,
"has_domains_portfolio_permission": False,
"has_domain_requests_portfolio_permission": False,
"has_edit_org_portfolio_permission": False,
"portfolio": None,
"has_organization_feature_flag": False,
}
@ -74,7 +73,6 @@ def portfolio_permissions(request):
"has_base_portfolio_permission": request.user.has_base_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_edit_org_portfolio_permission": request.user.has_edit_org_portfolio_permission(),
"portfolio": request.user.portfolio,
"has_organization_feature_flag": True,
}

View file

@ -170,8 +170,6 @@ class DomainSuborganizationForm(forms.ModelForm):
]
def __init__(self, *args, **kwargs):
# Get the incoming request object
self.request = kwargs.pop("request", None)
super().__init__(*args, **kwargs)
portfolio = self.instance.portfolio if self.instance else None

View file

@ -27,7 +27,6 @@ class UserPortfolioPermissionChoices(models.TextChoices):
VIEW_PORTFOLIO = "view_portfolio", "View organization"
EDIT_PORTFOLIO = "edit_portfolio", "Edit organization"
# TODO - think of other solutions
# Domain: field specific permissions
VIEW_SUBORGANIZATION = "view_suborganization", "View suborganization"
EDIT_SUBORGANIZATION = "edit_suborganization", "Edit suborganization"

View file

@ -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"
{% for name, value in widget.attrs.items %}
{{ name }}="{{ value }}"

View file

@ -245,7 +245,6 @@ class DomainSubOrganizationView(DomainFormBaseView):
"""Add domain_info.organization_name instance to make a bound form."""
form_kwargs = super().get_form_kwargs(*args, **kwargs)
form_kwargs["instance"] = self.object.domain_info
form_kwargs["request"] = self.request
return form_kwargs
def get_success_url(self):
@ -273,9 +272,7 @@ class DomainSeniorOfficialView(DomainFormBaseView):
def get_form_kwargs(self, *args, **kwargs):
"""Add domain_info.senior_official instance to make a bound form."""
form_kwargs = super().get_form_kwargs(*args, **kwargs)
org_user = self.request.user.is_org_user(self.request)
if org_user:
if self.request.user.is_org_user(self.request):
portfolio = Portfolio.objects.filter(information_portfolio=self.object.domain_info).first()
senior_official = portfolio.senior_official if portfolio else None
else:

View file

@ -30,10 +30,8 @@ class PortfolioDomainRequestsView(PortfolioDomainRequestsPermissionView, View):
template_name = "portfolio_requests.html"
def get(self, request):
if self.request.user.is_authenticated:
request.session["new_request"] = True
return render(request, "portfolio_requests.html")