Merge branch 'za/1924-remove-domain-info-for-analysts' into za/1948-remove-draft-domain-and-websites

This commit is contained in:
zandercymatics 2024-04-03 09:08:08 -06:00
commit 88ae1f92b1
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
5 changed files with 48 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"""