mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
added validation error for script and report constraint #15174
This commit is contained in:
parent
a063b5563c
commit
50e5bb9717
@ -380,6 +380,12 @@ class ObjectPermissionForm(BootstrapMixin, forms.ModelForm):
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user