-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Df/update permissions max cases #34810
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Descriptive commit messages are recommended. Otherwise, please squash the commits in this PR into a single commit to maintain a clean commit history.
corehq/apps/domain/forms.py
Outdated
def __init__(self, domain, can_edit_eula, *args, **kwargs): | ||
self.user = kwargs.pop('user', None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Newer versions of Python have syntax for keyword-only arguments.
def __init__(self, domain, can_edit_eula, *args, **kwargs): | |
self.user = kwargs.pop('user', None) | |
def __init__(self, domain, can_edit_eula, *args, user=None, **kwargs): | |
self.user = user |
@@ -1266,6 +1267,13 @@ def __init__(self, domain, can_edit_eula, *args, **kwargs): | |||
), | |||
) | |||
|
|||
if not self.user.is_staff: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for self.user
to be None
? If yes, this will throw AttributeError
. If not, the user
arg in the constructor could be changed to a required keyword-only argument:
def __init__(self, domain, can_edit_eula, *args, user, **kwargs):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not possible for self.user to be None since the dispatch in EditInternalDomainInfoView has the login_and_domain_required decorator.
eab75f2
to
5397f58
Compare
corehq/apps/domain/views/internal.py
Outdated
return DomainInternalForm(self.request.domain, can_edit_eula, self.request.user, | ||
self.request.POST) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think user
still has to be passed as a keyword argument, and as is it will raise TypeError
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that
Product Description
This disables the custom max update field in the project information settings for non-developers (django users with an is_staff value of False).
Technical Summary
https://dimagi.atlassian.net/browse/SAAS-15607
Feature Flag
Safety Assurance
Safety story
I observed the local effects of this change when user.is_staff was both True and False.
Automated test coverage
QA Plan
Rollback instructions
Labels & Review