diff --git a/work.py b/work.py
index cdeb3f2969..2c84f2a85a 100644
--- a/work.py
+++ b/work.py
@@ -73,13 +73,11 @@ class Work:
@classmethod
def __setup__(cls):
super(Work, cls).__setup__()
- cls._constraints += [
- ('check_recursion', 'recursive_dependency'),
- ]
- cls._error_messages.update({
- 'recursive_dependency': 'You can not create recursive '
- 'dependencies!',
- })
+
+ @classmethod
+ def validate(cls, works):
+ super(Work, cls).validate(works)
+ cls.check_recursion(works)
@classmethod
def check_recursion(cls, records, parent='successors'):
diff --git a/work.xml b/work.xml
index 42f56ced99..c34ee5b074 100644
--- a/work.xml
+++ b/work.xml
@@ -64,5 +64,14 @@ this repository contains the full copyright notices and license terms. -->
project.work
+
+ project.work
+ en_US
+ error
+ recursion_error
+ Recursion error: Project Work "%(rec_name)s" with parent "%(parent_rec_name)s" was configured as ancestor of itself.
+ project_plan
+
+