referenceError name changed to circularReferenceError
This commit is contained in:
parent
1fa8ed8a1f
commit
c8f0c25088
@ -9,7 +9,7 @@ from frappe import _
|
|||||||
|
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class ReferenceError(frappe.ValidationError): pass
|
class CircularReferenceError(frappe.ValidationError): pass
|
||||||
|
|
||||||
class Task(Document):
|
class Task(Document):
|
||||||
def get_feed(self):
|
def get_feed(self):
|
||||||
@ -82,7 +82,7 @@ class Task(Document):
|
|||||||
|
|
||||||
def check_recursion(self, task, task_list):
|
def check_recursion(self, task, task_list):
|
||||||
if task in task_list:
|
if task in task_list:
|
||||||
frappe.throw("Circular Reference Error", ReferenceError)
|
frappe.throw("Circular Reference Error", CircularReferenceError)
|
||||||
else :
|
else :
|
||||||
task_list.append(task)
|
task_list.append(task)
|
||||||
return frappe.db.get_value("Task", task, "depends_on")
|
return frappe.db.get_value("Task", task, "depends_on")
|
||||||
|
@ -7,7 +7,7 @@ from frappe.utils import getdate
|
|||||||
|
|
||||||
test_records = frappe.get_test_records('Task')
|
test_records = frappe.get_test_records('Task')
|
||||||
|
|
||||||
from erpnext.projects.doctype.task.task import ReferenceError
|
from erpnext.projects.doctype.task.task import CircularReferenceError
|
||||||
|
|
||||||
class TestTask(unittest.TestCase):
|
class TestTask(unittest.TestCase):
|
||||||
def test_circular_refereence(self):
|
def test_circular_refereence(self):
|
||||||
@ -37,7 +37,7 @@ class TestTask(unittest.TestCase):
|
|||||||
task1.update({
|
task1.update({
|
||||||
"depends_on": task3.name
|
"depends_on": task3.name
|
||||||
})
|
})
|
||||||
self.assertRaises(ReferenceError, task1.save)
|
self.assertRaises(CircularReferenceError, task1.save)
|
||||||
|
|
||||||
def test_reschedule_depending_task(self):
|
def test_reschedule_depending_task(self):
|
||||||
task1 = frappe.new_doc('Task')
|
task1 = frappe.new_doc('Task')
|
||||||
|
Loading…
Reference in New Issue
Block a user