Improved error handling if proposed calendar is not valid.

This commit is contained in:
Martin Edenhofer 2019-05-20 11:22:36 +02:00
parent 6ae6ee44ba
commit 9775af5e98

View file

@ -38,7 +38,9 @@ returns calendar object
# call for calendar suggestion
calendar_details = Service::GeoCalendar.location(ip)
return if !calendar_details
return if calendar_details.blank?
return if calendar_details['name'].blank?
return if calendar_details['business_hours'].blank?
calendar_details['name'] = Calendar.generate_uniq_name(calendar_details['name'])
calendar_details['default'] = true