refactor: Clean up mutable defaults and add CI check (#27828) (#27841)

* refactor: Clean up mutable defaults and add CI check

(cherry picked from commit 772d4753e7)

Co-authored-by: Chillar Anand <chillar@avilpage.com>
This commit is contained in:
mergify[bot]
2021-10-07 09:57:35 +00:00
committed by GitHub
parent 4da5cb36e7
commit dd0cefbeb9
17 changed files with 62 additions and 24 deletions

View File

@@ -62,7 +62,9 @@ class InpatientRecord(Document):
admit_patient(self, service_unit, check_in, expected_discharge)
@frappe.whitelist()
def discharge(self, check_out=now_datetime()):
def discharge(self, check_out=None):
if not check_out:
check_out = now_datetime()
if (getdate(check_out) < getdate(self.admitted_datetime)):
frappe.throw(_('Discharge date cannot be less than Admission date'))
discharge_patient(self, check_out)

View File

@@ -611,7 +611,7 @@ def render_docs_as_html(docs):
@frappe.whitelist()
def render_doc_as_html(doctype, docname, exclude_fields = []):
def render_doc_as_html(doctype, docname, exclude_fields = None):
"""
Render document as HTML
"""
@@ -622,6 +622,9 @@ def render_doc_as_html(doctype, docname, exclude_fields = []):
sec_on = has_data = False
col_on = 0
if exclude_fields is None:
exclude_fields = []
for df in meta.fields:
# on section break append previous section and html to doc html
if df.fieldtype == "Section Break":