diff --git a/erpnext/crm/doctype/appointment/appointment.py b/erpnext/crm/doctype/appointment/appointment.py index 29d092245b..8480f2ca44 100644 --- a/erpnext/crm/doctype/appointment/appointment.py +++ b/erpnext/crm/doctype/appointment/appointment.py @@ -245,9 +245,11 @@ def _get_employee_from_user(user): def add_agent_assignment(args): - doc = frappe.get_cached_doc(args.get("doctype"), args.get("name")) + doctype = args.get("doctype") + docname = args.get("name") + for assign_to in args.get("assign_to"): - if not frappe.has_permission(doc=doc, user=assign_to): - add_docshare(doc.doctype, doc.name, assign_to, flags={"ignore_share_permission": True}) + if not frappe.has_permission(doctype=doctype, doc=docname, user=assign_to): + add_docshare(doctype, docname, assign_to, flags={"ignore_share_permission": True}) add_assignment(args) diff --git a/erpnext/www/book_appointment/verify/index.html b/erpnext/www/book_appointment/verify/index.html index eaaf8ecfc7..58c07e85cc 100644 --- a/erpnext/www/book_appointment/verify/index.html +++ b/erpnext/www/book_appointment/verify/index.html @@ -5,12 +5,14 @@ {% endblock%} {% block page_content %} - {%- set alert_class = 'alert-success' if success else 'alert-danger' -%} -
- {% if success==True %} + + {% if success==True %} +
{{ _("Your email has been verified and your appointment has been scheduled") }} - {% else %} +
+ {% else %} +
{{ _("Verification failed please check the link") }} - {% endif %} -
+
+ {% endif %} {% endblock%} diff --git a/erpnext/www/book_appointment/verify/index.py b/erpnext/www/book_appointment/verify/index.py index 4a1ed75ee9..3beb8667ae 100644 --- a/erpnext/www/book_appointment/verify/index.py +++ b/erpnext/www/book_appointment/verify/index.py @@ -14,6 +14,7 @@ def get_context(context): appointment = frappe.get_doc("Appointment", appointment_name) appointment.set_verified(email) context.success = True + return context else: context.success = False - return context + return context