fix(treewide): manual ruff fixes

(cherry picked from commit f63396ef47)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang
2024-03-27 12:16:13 +05:30
parent 960ef14b7a
commit 7828eee014
35 changed files with 121 additions and 137 deletions

View File

@@ -112,7 +112,13 @@ class TestHolidayList(unittest.TestCase):
frappe.local.lang = lang
def make_holiday_list(name, from_date=getdate() - timedelta(days=10), to_date=getdate(), holiday_dates=None):
def make_holiday_list(name, from_date=None, to_date=None, holiday_dates=None):
if from_date is None:
from_date = getdate() - timedelta(days=10)
if to_date is None:
to_date = getdate()
frappe.delete_doc_if_exists("Holiday List", name, force=1)
doc = frappe.get_doc(
{

View File

@@ -486,12 +486,7 @@ def is_deletion_doc_running(company: str | None = None, err_msg: str | None = No
def check_for_running_deletion_job(doc, method=None):
# Check if DocType has 'company' field
df = qb.DocType("DocField")
if (
not_allowed := qb.from_(df)
.select(df.parent)
.where((df.fieldname == "company") & (df.parent == doc.doctype))
.run()
):
if qb.from_(df).select(df.parent).where((df.fieldname == "company") & (df.parent == doc.doctype)).run():
is_deletion_doc_running(
doc.company, _("Cannot make any transactions until the deletion job is completed")
)