[Code Cleanup] Fix a broad except call

It is enough to catch `UnknownTimeZoneError` here.
This commit is contained in:
Gergely Polonkai 2018-07-03 08:31:21 +02:00
parent 6e0d50552d
commit a5bf841898
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ class TimezoneField(SelectField):
try:
self.data = pytz.timezone(value)
except Exception as exc:
except pytz.exceptions.UnknownTimeZoneError:
raise ValueError(f'Unknown time zone {value}')
def iter_choices(self):