staff can edit primary lookup id

This commit is contained in:
Your Name 2023-07-01 13:13:39 -04:00 committed by Henri Dickson
parent bffe467321
commit 4184b0468a
2 changed files with 5 additions and 3 deletions

View file

@ -7,7 +7,7 @@ from common.forms import PreviewImageInput
CatalogForms = {}
def _EditForm(item_model: Item):
def _EditForm(item_model):
item_fields = (
["id"]
+ item_model.METADATA_COPY_LIST

View file

@ -86,7 +86,8 @@ def edit(request, item_path, item_uuid):
form_cls = CatalogForms[item.__class__.__name__]
form = form_cls(instance=item)
if (
item.external_resources.all().count() > 0
not request.user.is_staff
and item.external_resources.all().count() > 0
and item.primary_lookup_id_value
and item.primary_lookup_id_type in IdealIdTypes
):
@ -98,7 +99,8 @@ def edit(request, item_path, item_uuid):
form_cls = CatalogForms[item.__class__.__name__]
form = form_cls(request.POST, request.FILES, instance=item)
if (
item.external_resources.all().count() > 0
not request.user.is_staff
and item.external_resources.all().count() > 0
and item.primary_lookup_id_value
and item.primary_lookup_id_type in IdealIdTypes
):