Skip to content

Commit

Permalink
added validation error for script and report constraint #15174
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi1693 authored and jeremystretch committed Feb 20, 2024
1 parent a063b55 commit 50e5bb9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions netbox/users/forms/model_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,12 @@ def clean(self):
constraints = [constraints]
for ct in object_types:
model = ct.model_class()

if model._meta.model_name in ['script', 'report']:
raise forms.ValidationError({
'constraints': _('Constraints are not supported for this object type.')
})

try:
tokens = {
CONSTRAINT_TOKEN_USER: 0, # Replace token with a null user ID
Expand Down

0 comments on commit 50e5bb9

Please sign in to comment.