Commit dd9516a9 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[schema] Add a constraint on process_input_file preventing usage of script's file

parent d4418e91bd9c
......@@ -42,5 +42,5 @@ add_relation_type('process_stderr')
sync_schema_props_perms('DataTransformationProcess')
sync_schema_props_perms('DataValidationProcess')
sync_schema_props_perms('process_input_file', syncprops=False)
sync_schema_props_perms('process_input_file')
sync_schema_props_perms('File', syncprops=False)
......@@ -20,7 +20,7 @@ from yams.buildobjs import (ComputedRelation, EntityType, RelationDefinition,
Int, String)
from cubicweb.schema import (RRQLExpression, ERQLExpression,
WorkflowableEntityType)
RQLConstraint, WorkflowableEntityType)
from cubes.file.schema import File
......@@ -70,6 +70,10 @@ class process_input_file(RelationDefinition):
object = 'File'
cardinality = '?*'
description = _('input file of the data process')
constraints = [
RQLConstraint('NOT EXISTS(SC implemented_by O)',
msg=_('file is used by a script')),
]
class validated_by(RelationDefinition):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment