Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:frappe/frappe into drop-py2-code
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Jun 3, 2021
2 parents 8558116 + 099c2f0 commit 2ad9d20
Show file tree
Hide file tree
Showing 14 changed files with 410 additions and 303 deletions.
27 changes: 24 additions & 3 deletions frappe/__init__.py
Expand Up @@ -527,16 +527,20 @@ def sendmail(recipients=[], sender="", subject="No Subject", message="No Message
if not delayed:
now = True

from frappe.email import queue
queue.send(recipients=recipients, sender=sender,
from frappe.email.doctype.email_queue.email_queue import QueueBuilder
builder = QueueBuilder(recipients=recipients, sender=sender,
subject=subject, message=message, text_content=text_content,
reference_doctype = doctype or reference_doctype, reference_name = name or reference_name, add_unsubscribe_link=add_unsubscribe_link,
unsubscribe_method=unsubscribe_method, unsubscribe_params=unsubscribe_params, unsubscribe_message=unsubscribe_message,
attachments=attachments, reply_to=reply_to, cc=cc, bcc=bcc, message_id=message_id, in_reply_to=in_reply_to,
send_after=send_after, expose_recipients=expose_recipients, send_priority=send_priority, queue_separately=queue_separately,
communication=communication, now=now, read_receipt=read_receipt, is_notification=is_notification,
communication=communication, read_receipt=read_receipt, is_notification=is_notification,
inline_images=inline_images, header=header, print_letterhead=print_letterhead, with_container=with_container)

# build email queue and send the email if send_now is True.
builder.process(send_now=now)


whitelisted = []
guest_methods = []
xss_safe_methods = []
Expand Down Expand Up @@ -1692,6 +1696,23 @@ def safe_eval(code, eval_globals=None, eval_locals=None):
"round": round
}

UNSAFE_ATTRIBUTES = {
# Generator Attributes
"gi_frame", "gi_code",
# Coroutine Attributes
"cr_frame", "cr_code", "cr_origin",
# Async Generator Attributes
"ag_code", "ag_frame",
# Traceback Attributes
"tb_frame", "tb_next",
# Format Attributes
"format", "format_map",
}

for attribute in UNSAFE_ATTRIBUTES:
if attribute in code:
throw('Illegal rule {0}. Cannot use "{1}"'.format(bold(code), attribute))

if '__' in code:
throw('Illegal rule {0}. Cannot use "__"'.format(bold(code)))

Expand Down
10 changes: 9 additions & 1 deletion frappe/core/doctype/module_def/module_def.json
Expand Up @@ -55,7 +55,7 @@
"link_fieldname": "module"
}
],
"modified": "2020-08-06 12:39:30.740379",
"modified": "2021-06-02 13:04:53.118716",
"modified_by": "Administrator",
"module": "Core",
"name": "Module Def",
Expand All @@ -69,6 +69,7 @@
"read": 1,
"report": 1,
"role": "Administrator",
"select": 1,
"share": 1,
"write": 1
},
Expand All @@ -78,7 +79,14 @@
"read": 1,
"report": 1,
"role": "System Manager",
"select": 1,
"write": 1
},
{
"read": 1,
"report": 1,
"role": "All",
"select": 1
}
],
"show_name_in_global_search": 1,
Expand Down
12 changes: 1 addition & 11 deletions frappe/custom/doctype/customize_form/customize_form.json
Expand Up @@ -288,16 +288,6 @@
"fieldname": "autoname",
"fieldtype": "Data",
"label": "Auto Name"
},
{
"fieldname": "default_email_template",
"fieldtype": "Link",
"label": "Default Email Template",
"options": "Email Template"
},
{
"fieldname": "column_break_26",
"fieldtype": "Column Break"
}
],
"hide_toolbar": 1,
Expand All @@ -306,7 +296,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2021-04-29 21:21:06.476372",
"modified": "2021-06-02 06:49:16.782806",
"modified_by": "Administrator",
"module": "Custom",
"name": "Customize Form",
Expand Down

0 comments on commit 2ad9d20

Please sign in to comment.