mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Fixes #15115: Fix unhandled exception with invalid permission constraints
This commit is contained in:
parent
c7ae2db8e3
commit
1f800a975f
@ -385,7 +385,7 @@ class ObjectPermissionForm(BootstrapMixin, forms.ModelForm):
|
||||
CONSTRAINT_TOKEN_USER: 0, # Replace token with a null user ID
|
||||
}
|
||||
model.objects.filter(qs_filter_from_constraints(constraints, tokens)).exists()
|
||||
except FieldError as e:
|
||||
except (FieldError, ValueError) as e:
|
||||
raise forms.ValidationError({
|
||||
'constraints': _('Invalid filter for {model}: {error}').format(model=model, error=e)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user