Unit tests

This commit is contained in:
zandercymatics 2024-04-03 12:19:40 -06:00
parent ff5fe87b61
commit 269bb0cab3
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 82 additions and 2 deletions

View file

@ -765,7 +765,7 @@ class WebsiteAdmin(ListHeaderAdmin):
"website",
]
search_help_text = "Search by website."
def get_model_perms(self, request):
"""
Return empty perms dict thus hiding the model from admin index.
@ -798,7 +798,9 @@ class WebsiteAdmin(ListHeaderAdmin):
if analyst_perm and not superuser_perm:
opts = obj._meta
pk_value = obj._get_pk_val()
return HttpResponseRedirect(reverse('admin:%s_%s_change' % (opts.app_label, opts.model_name), args=(pk_value,)))
return HttpResponseRedirect(
reverse("admin:%s_%s_change" % (opts.app_label, opts.model_name), args=(pk_value,))
)
return super().response_change(request, obj)