forked from gergely/calendar-social
[Code Cleanup] Fix a broad except call
It is enough to catch `UnknownTimeZoneError` here.
This commit is contained in:
parent
6e0d50552d
commit
a5bf841898
@ -59,7 +59,7 @@ class TimezoneField(SelectField):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
self.data = pytz.timezone(value)
|
self.data = pytz.timezone(value)
|
||||||
except Exception as exc:
|
except pytz.exceptions.UnknownTimeZoneError:
|
||||||
raise ValueError(f'Unknown time zone {value}')
|
raise ValueError(f'Unknown time zone {value}')
|
||||||
|
|
||||||
def iter_choices(self):
|
def iter_choices(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user