Fixed typo in exception keyword. Fixes #5539

pull/33/head
Yogesh Mahajan 2020-05-28 18:11:41 +05:30 committed by Akshay Joshi
parent e10f1274dc
commit 09b76b306c
2 changed files with 9 additions and 8 deletions

View File

@ -17,4 +17,5 @@ Housekeeping
Bug fixes
*********
| `Issue #5416 <https://redmine.postgresql.org/issues/5416>`_ - Ensure that the query tool panel gets closed when clicking on the 'Don't Save' button.
| `Issue #5416 <https://redmine.postgresql.org/issues/5416>`_ - Ensure that the query tool panel gets closed when clicking on the 'Don't Save' button.
| `Issue #5539 <https://redmine.postgresql.org/issues/5539>`_ - Fixed typo in exception keyword.

View File

@ -120,19 +120,19 @@ class _Preference(object):
try:
return int(res.value)
except Exception as e:
current_app.logger.exeception(e)
current_app.logger.exception(e)
return self.default
if self._type == 'numeric':
try:
return decimal.Decimal(res.value)
except Exception as e:
current_app.logger.exeception(e)
current_app.logger.exception(e)
return self.default
if self._type == 'date' or self._type == 'datetime':
try:
return dateutil_parser.parse(res.value)
except Exception as e:
current_app.logger.exeception(e)
current_app.logger.exception(e)
return self.default
if self._type == 'options':
for opt in self.options:
@ -149,7 +149,7 @@ class _Preference(object):
try:
return json.loads(res.value)
except Exception as e:
current_app.logger.exeception(e)
current_app.logger.exception(e)
return self.default
return res.value
@ -194,13 +194,13 @@ class _Preference(object):
try:
value = dateutil_parser.parse(value).date()
except Exception as e:
current_app.logger.exeception(e)
current_app.logger.exception(e)
return False, gettext("Invalid value for a date option.")
elif self._type == 'datetime':
try:
value = dateutil_parser.parse(value)
except Exception as e:
current_app.logger.exeception(e)
current_app.logger.exception(e)
return False, gettext("Invalid value for a datetime option.")
elif self._type == 'options':
has_value = False
@ -214,7 +214,7 @@ class _Preference(object):
try:
value = json.dumps(value)
except Exception as e:
current_app.logger.exeception(e)
current_app.logger.exception(e)
return False, gettext(
"Invalid value for a keyboard shortcut option."
)