Skip to content

Commit

Permalink
disabled custom max update field for non-admins
Browse files Browse the repository at this point in the history
  • Loading branch information
dfadil committed Jun 24, 2024
1 parent 48e2410 commit eab75f2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion corehq/apps/domain/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,6 @@ class DomainInternalForm(forms.Form, SubAreaMixin):

def __init__(self, domain, can_edit_eula, *args, **kwargs):
self.user = kwargs.pop('user', None)
print("User is staff: ", self.user.is_staff, "\n\n\n")
super(DomainInternalForm, self).__init__(*args, **kwargs)
self.domain = domain
self.can_edit_eula = can_edit_eula
Expand Down Expand Up @@ -1268,6 +1267,13 @@ def __init__(self, domain, can_edit_eula, *args, **kwargs):
),
)

if not self.user.is_staff:
self.fields['auto_case_update_limit'].disabled = True
self.fields['auto_case_update_limit'].help_text = (
'Case update rule limits are only modifiable by Dimagi admins. '
'Please reach out to support@dimagi.com if you wish to update this setting.'
)

@property
def current_values(self):
return {
Expand Down

0 comments on commit eab75f2

Please sign in to comment.