Merge pull request #24496 from frappe/template-task-parent-child-deadlock

fix: Template task parent child deadlock
This commit is contained in:
Deepesh Garg 2021-01-30 18:50:24 +05:30 committed by GitHub
commit a67daefb41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,14 +77,7 @@ class Task(NestedSet):
def validate_dependencies_for_template_task(self):
if self.is_template:
self.validate_parent_template_task()
self.validate_depends_on_tasks()
def validate_parent_template_task(self):
if self.parent_task:
if not frappe.db.get_value("Task", self.parent_task, "is_template"):
parent_task_format = """<a href="#Form/Task/{0}">{0}</a>""".format(self.parent_task)
frappe.throw(_("Parent Task {0} is not a Template Task").format(parent_task_format))
def validate_depends_on_tasks(self):
if self.depends_on: