[fix] if terms exists then only call render_template

This commit is contained in:
Saurabh 2017-01-07 08:18:10 +05:30
parent 0dab40f4a1
commit f65e8de5a5

View File

@ -18,4 +18,6 @@ def get_terms_and_conditions(template_name, doc):
doc = json.loads(doc)
terms_and_conditions = frappe.get_doc("Terms and Conditions", template_name)
return frappe.render_template(terms_and_conditions.terms, doc)
if terms_and_conditions.terms:
return frappe.render_template(terms_and_conditions.terms, doc)