Pranav Nachanekar | df1a5a9 | 2019-09-20 10:08:48 +0530 | [diff] [blame] | 1 | import frappe |
Pranav Nachanekar | 8b744b2 | 2019-09-23 15:55:35 +0530 | [diff] [blame] | 2 | from frappe.utils.verified_command import verify_request |
Pranav Nachanekar | df1a5a9 | 2019-09-20 10:08:48 +0530 | [diff] [blame] | 3 | @frappe.whitelist(allow_guest=True) |
| 4 | def get_context(context): |
Pranav Nachanekar | 8b744b2 | 2019-09-23 15:55:35 +0530 | [diff] [blame] | 5 | if not verify_request(): |
| 6 | context.success = False |
| 7 | return context |
Pranav Nachanekar | d45c12b | 2019-09-24 16:07:02 +0530 | [diff] [blame] | 8 | |
Pranav Nachanekar | df1a5a9 | 2019-09-20 10:08:48 +0530 | [diff] [blame] | 9 | email = frappe.form_dict['email'] |
| 10 | appointment_name = frappe.form_dict['appointment'] |
Pranav Nachanekar | 8b744b2 | 2019-09-23 15:55:35 +0530 | [diff] [blame] | 11 | |
Pranav Nachanekar | df1a5a9 | 2019-09-20 10:08:48 +0530 | [diff] [blame] | 12 | if email and appointment_name: |
| 13 | appointment = frappe.get_doc('Appointment',appointment_name) |
| 14 | appointment.set_verified(email) |
| 15 | context.success = True |
| 16 | return context |
| 17 | else: |
Pranav Nachanekar | df1a5a9 | 2019-09-20 10:08:48 +0530 | [diff] [blame] | 18 | context.success = False |
| 19 | return context |