Skip to content

Commit

Permalink
Fixes #15115: Fix unhandled exception with invalid permission constra…
Browse files Browse the repository at this point in the history
…ints
  • Loading branch information
jeremystretch committed Feb 13, 2024
1 parent c7ae2db commit 5a37207
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netbox/users/forms/model_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

0 comments on commit 5a37207

Please sign in to comment.