In operations.py, there's code to handle timezones which Db2 doesn't natively support. This requires pytz and when it is not available it tries to raise an exception, but there's a couple problems:
The NotSupportedException is not defined
The exception object is not raised
No code handles the exception
I think we should handle this properly. We could start by using an appropriate exception (maybe local to the module, since it's only used there) and handling it at the two call sites within the module and mapping it to the appropriate Django exception (or don't handle it and instead use the appropriate Django exception directy from _get_utcoffset).
Another, possibly better idea is to just require pytz in order to function so we don't have to handle the case where it is not available.
In operations.py, there's code to handle timezones which Db2 doesn't natively support. This requires pytz and when it is not available it tries to raise an exception, but there's a couple problems:
raise
dI think we should handle this properly. We could start by using an appropriate exception (maybe local to the module, since it's only used there) and handling it at the two call sites within the module and mapping it to the appropriate Django exception (or don't handle it and instead use the appropriate Django exception directy from
_get_utcoffset
).Another, possibly better idea is to just require pytz in order to function so we don't have to handle the case where it is not available.