diff --git a/appa/tasks.py b/appa/tasks.py index 45cb70d..dbaa415 100644 --- a/appa/tasks.py +++ b/appa/tasks.py @@ -69,11 +69,12 @@ def update_call_requests_task(self): service_name = call_specialities[booking['user']['doctor']['speciality']].name for booking_service in booking['services']: - service_code = booking_service['service']['code'] - for regex, bot_talking in call_services.items(): - if re.match(regex, service_code.strip()): - service_name = bot_talking - break + if booking_service['service'] is not None: + service_code = booking_service['service']['code'] + for regex, bot_talking in call_services.items(): + if re.match(regex, service_code.strip()): + service_name = bot_talking + break if lpu is None or service_name is None: continue