Merge pull request #1977 from cisagov/za/1924-remove-domain-info-for-analysts

Ticket #1924: Remove domain info for analysts
This commit is contained in:
zandercymatics 2024-04-03 10:39:34 -06:00 committed by GitHub
commit 07f0fd9b93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 163 additions and 10 deletions

View file

@ -1436,6 +1436,13 @@ class DomainInformationInline(admin.StackedInline):
"submitter",
]
def has_change_permission(self, request, obj=None):
"""Custom has_change_permission override so that we can specify that
analysts can edit this through this inline, but not through the model normally"""
if request.user.has_perm("registrar.analyst_access_permission"):
return True
return super().has_change_permission(request, obj)
def formfield_for_manytomany(self, db_field, request, **kwargs):
"""customize the behavior of formfields with manytomany relationships. the customized
behavior includes sorting of objects in lists as well as customizing helper text"""