Fall back to 'pretty' hours display if config is invalid etc.

This commit is contained in:
Lance Edgar 2017-05-16 14:00:13 -05:00
parent 3111aad7cd
commit 76e71d634e

View file

@ -355,6 +355,8 @@ class TimeSheetView(View):
if self.request.user:
hours_style = self.rattail_config.get('tailbone', 'hours_style.{}'.format(self.request.user.username),
default='pretty')
if hours_style != 'decimal':
hours_style = 'pretty'
shift_type = 'scheduled' if cls is model.ScheduledShift else 'worked'
min_time = localtime(self.rattail_config, datetime.datetime.combine(weekdays[0], datetime.time(0)))