refactor: lint
fix: removed time.sleep
This commit is contained in:
parent
7c8af96046
commit
3759e5bbcd
3 changed files with 4 additions and 13 deletions
|
|
@ -70,10 +70,6 @@ class SubmissionQueue(Document):
|
|||
def background_submission(self, to_be_queued_doc: Document, action_for_queuing: str):
|
||||
# Set the job id for that submission doctype
|
||||
self.update_job_id(get_current_job().id)
|
||||
import time
|
||||
|
||||
time.sleep(10)
|
||||
|
||||
_action = action_for_queuing.lower()
|
||||
if _action == "update":
|
||||
_action = "submit"
|
||||
|
|
|
|||
|
|
@ -19,11 +19,7 @@ def savedocs(doc, action):
|
|||
# action
|
||||
doc.docstatus = {"Save": 0, "Submit": 1, "Update": 1, "Cancel": 2}[action]
|
||||
if doc.docstatus == 1:
|
||||
if (
|
||||
action == "Submit"
|
||||
and doc.meta.queue_in_background
|
||||
and not is_scheduler_inactive()
|
||||
):
|
||||
if action == "Submit" and doc.meta.queue_in_background and not is_scheduler_inactive():
|
||||
queue_submission(doc, action)
|
||||
return
|
||||
doc.submit()
|
||||
|
|
|
|||
|
|
@ -27,13 +27,12 @@ class TestDocumentLocks(FrappeTestCase):
|
|||
|
||||
# Checking for persistant locks across all instances.
|
||||
doc = frappe.get_doc("ToDo", todo.name)
|
||||
self.assertEquals(doc.is_locked, True)
|
||||
self.assertEqual(doc.is_locked, True)
|
||||
|
||||
with self.assertRaises(frappe.DocumentLockedError):
|
||||
doc.description = "Random"
|
||||
doc.save()
|
||||
|
||||
doc.unlock()
|
||||
self.assertEquals(doc.is_locked, False)
|
||||
self.assertEquals(todo.is_locked, False)
|
||||
|
||||
self.assertEqual(doc.is_locked, False)
|
||||
self.assertEqual(todo.is_locked, False)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue