fix:formatting

This commit is contained in:
0Pranav 2019-11-07 12:54:48 +05:30
parent 75db6f7073
commit 51208b3f0b

View File

@ -102,11 +102,11 @@ def create_appointment(date, time, tz, contact):
scheduled_time = scheduled_time.replace(tzinfo=None)
appointment.scheduled_time = scheduled_time
contact = json.loads(contact)
appointment.customer_name = contact['name']
appointment.customer_phone_number = contact['number']
appointment.customer_skype = contact['skype']
appointment.customer_details = contact['notes']
appointment.customer_email = contact['email']
appointment.customer_name = contact.get('name',None)
appointment.customer_phone_number = contact.get('number', None)
appointment.customer_skype = contact.get('skype', None)
appointment.customer_details = contact.get('notes', None)
appointment.customer_email = contact.get('email', None)
appointment.status = 'Open'
appointment.insert()