From 5a372071784cd1b8d95e9f2af62f1c5cdea0c909 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 13 Feb 2024 09:34:59 -0500 Subject: [PATCH] Fixes #15115: Fix unhandled exception with invalid permission constraints --- netbox/users/forms/model_forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/users/forms/model_forms.py b/netbox/users/forms/model_forms.py index 99320fa25c..aa5811cd15 100644 --- a/netbox/users/forms/model_forms.py +++ b/netbox/users/forms/model_forms.py @@ -385,7 +385,7 @@ def clean(self): 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) })