added validation error for script and report constraint #15174
This commit is contained in:

committed by
Jeremy Stretch

parent
a063b5563c
commit
50e5bb9717
@@ -380,6 +380,12 @@ class ObjectPermissionForm(BootstrapMixin, forms.ModelForm):
|
|||||||
constraints = [constraints]
|
constraints = [constraints]
|
||||||
for ct in object_types:
|
for ct in object_types:
|
||||||
model = ct.model_class()
|
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:
|
try:
|
||||||
tokens = {
|
tokens = {
|
||||||
CONSTRAINT_TOKEN_USER: 0, # Replace token with a null user ID
|
CONSTRAINT_TOKEN_USER: 0, # Replace token with a null user ID
|
||||||
|
Reference in New Issue
Block a user