mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-12 20:49:41 +02:00
tests
This commit is contained in:
parent
5ffce473b2
commit
ab12e9f27d
2 changed files with 141 additions and 0 deletions
|
@ -281,6 +281,7 @@ class PortfolioPermissionsForm(forms.ModelForm):
|
|||
|
||||
# Store the selected role as a list (assuming single role assignment)
|
||||
self.instance.roles = [cleaned_data.get("role")] if cleaned_data.get("role") else []
|
||||
cleaned_data["roles"] = self.instance.roles
|
||||
|
||||
# If the selected role is "organization_member," store additional permissions
|
||||
if self.instance.roles == [UserPortfolioRoleChoices.ORGANIZATION_MEMBER]:
|
||||
|
@ -297,6 +298,7 @@ class PortfolioPermissionsForm(forms.ModelForm):
|
|||
else:
|
||||
# If the user is an admin, clear any additional permissions
|
||||
self.instance.additional_permissions = []
|
||||
cleaned_data["additional_permissions"] = self.instance.additional_permissions
|
||||
|
||||
return cleaned_data
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue