mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -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
|
CONSTRAINT_TOKEN_USER: 0, # Replace token with a null user ID
|
||||||
}
|
}
|
||||||
model.objects.filter(qs_filter_from_constraints(constraints, tokens)).exists()
|
model.objects.filter(qs_filter_from_constraints(constraints, tokens)).exists()
|
||||||
except FieldError as e:
|
except (FieldError, ValueError) as e:
|
||||||
raise forms.ValidationError({
|
raise forms.ValidationError({
|
||||||
'constraints': _('Invalid filter for {model}: {error}').format(model=model, error=e)
|
'constraints': _('Invalid filter for {model}: {error}').format(model=model, error=e)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user