mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-27 04:58:42 +02:00
lint
This commit is contained in:
parent
3bf3c5a8a6
commit
7a42b913ed
3 changed files with 11 additions and 7 deletions
|
@ -422,11 +422,15 @@ class PortfolioMemberForm(BasePortfolioMemberForm):
|
||||||
if role and self.instance.user.is_only_admin_of_portfolio(self.instance.portfolio):
|
if role and self.instance.user.is_only_admin_of_portfolio(self.instance.portfolio):
|
||||||
# This is how you associate a validation error to a particular field.
|
# This is how you associate a validation error to a particular field.
|
||||||
# The alternative is to do this in clean_role, but execution order matters.
|
# The alternative is to do this in clean_role, but execution order matters.
|
||||||
raise forms.ValidationError({"role": forms.ValidationError(
|
raise forms.ValidationError(
|
||||||
"You can't change your member access because you're "
|
{
|
||||||
"the only admin for this organization. "
|
"role": forms.ValidationError(
|
||||||
"To change your access, you'll need to add another admin."
|
"You can't change your member access because you're "
|
||||||
)})
|
"the only admin for this organization. "
|
||||||
|
"To change your access, you'll need to add another admin."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class PortfolioInvitedMemberForm(BasePortfolioMemberForm):
|
class PortfolioInvitedMemberForm(BasePortfolioMemberForm):
|
||||||
|
|
|
@ -2159,7 +2159,7 @@ class TestPortfolioMemberDeleteView(WebTest):
|
||||||
# WSGIRequest protocol is basically the HTTPRequest but in Django form (ie POST '/member/1/delete')
|
# WSGIRequest protocol is basically the HTTPRequest but in Django form (ie POST '/member/1/delete')
|
||||||
self.assertIsInstance(args[0], WSGIRequest)
|
self.assertIsInstance(args[0], WSGIRequest)
|
||||||
# Check that the error message matches the expected error message
|
# Check that the error message matches the expected error message
|
||||||
self.assertEqual(args[1], expected_error_message)
|
self.assertIn(expected_error_message, args[1])
|
||||||
|
|
||||||
# Location is used for a 3xx HTTP status code to indicate that the URL was redirected
|
# Location is used for a 3xx HTTP status code to indicate that the URL was redirected
|
||||||
# and then confirm that we're still on the Manage Members page
|
# and then confirm that we're still on the Manage Members page
|
||||||
|
|
|
@ -267,7 +267,7 @@ class PortfolioMemberEditView(DetailView, View):
|
||||||
"form": form,
|
"form": form,
|
||||||
"member": user,
|
"member": user,
|
||||||
"portfolio_permission": portfolio_permission,
|
"portfolio_permission": portfolio_permission,
|
||||||
"is_only_admin": request.user.is_only_admin_of_portfolio(portfolio_permission.portfolio)
|
"is_only_admin": request.user.is_only_admin_of_portfolio(portfolio_permission.portfolio),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue