brotherton-erpnext/erpnext/www/book_appointment/verify/index.py

21 lines
479 B
Python
Raw Normal View History

2019-09-20 04:38:48 +00:00
import frappe
from frappe.utils.verified_command import verify_request
2019-09-20 04:38:48 +00:00
def get_context(context):
2019-11-07 07:17:00 +00:00
if not verify_request():
context.success = False
return context
2019-09-24 10:37:02 +00:00
2022-03-28 13:22:46 +00:00
email = frappe.form_dict["email"]
appointment_name = frappe.form_dict["appointment"]
2019-11-07 07:17:00 +00:00
if email and appointment_name:
2022-03-28 13:22:46 +00:00
appointment = frappe.get_doc("Appointment", appointment_name)
2019-11-07 07:17:00 +00:00
appointment.set_verified(email)
context.success = True
2022-12-15 12:32:14 +00:00
return context
2019-11-07 07:17:00 +00:00
else:
context.success = False
2022-12-15 12:32:14 +00:00
return context