fix: reference before assignement error

This commit is contained in:
0Pranav 2019-11-13 11:12:38 +05:30
parent 83100c9c84
commit db64c69dac

View File

@ -86,8 +86,8 @@ def create_appointment(date, time, tz, contact):
scheduled_time = convert_to_system_timezone(tz, scheduled_time)
scheduled_time = scheduled_time.replace(tzinfo=None)
# Create a appointment document from form
appointment.scheduled_time = scheduled_time
appointment = frappe.new_doc('Appointment')
appointment.scheduled_time = scheduled_time
contact = json.loads(contact)
appointment.customer_name = contact.get('name',None)
appointment.customer_phone_number = contact.get('number', None)