mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Broaden except section for HTTP request in dashboard
get_data can return exceptions other than ConnectorException, and when it does, we want to simply not show the update section, rather than crashing. Related: #2717
This commit is contained in:
parent
00666c4f52
commit
4af4f30cde
1 changed files with 2 additions and 2 deletions
|
@ -16,7 +16,6 @@ from csp.decorators import csp_update
|
||||||
|
|
||||||
from bookwyrm import models, settings
|
from bookwyrm import models, settings
|
||||||
from bookwyrm.connectors.abstract_connector import get_data
|
from bookwyrm.connectors.abstract_connector import get_data
|
||||||
from bookwyrm.connectors.connector_manager import ConnectorException
|
|
||||||
from bookwyrm.utils import regex
|
from bookwyrm.utils import regex
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,6 +60,7 @@ class Dashboard(View):
|
||||||
)
|
)
|
||||||
|
|
||||||
# check version
|
# check version
|
||||||
|
|
||||||
try:
|
try:
|
||||||
release = get_data(settings.RELEASE_API, timeout=3)
|
release = get_data(settings.RELEASE_API, timeout=3)
|
||||||
available_version = release.get("tag_name", None)
|
available_version = release.get("tag_name", None)
|
||||||
|
@ -69,7 +69,7 @@ class Dashboard(View):
|
||||||
):
|
):
|
||||||
data["current_version"] = settings.VERSION
|
data["current_version"] = settings.VERSION
|
||||||
data["available_version"] = available_version
|
data["available_version"] = available_version
|
||||||
except ConnectorException:
|
except: # pylint: disable= bare-except
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return TemplateResponse(request, "settings/dashboard/dashboard.html", data)
|
return TemplateResponse(request, "settings/dashboard/dashboard.html", data)
|
||||||
|
|
Loading…
Reference in a new issue