1
0
Fork 0

Removes outdated/unused version and updating code

I had the bright idea of creating this update script but it doesn't work
and hasn't been maintained, so it's just sitting there causing confusing
and requiring weird things to exist in other places.

Now, the unused `version` field can be removed and I can scrap the
management command for getting versions.
This commit is contained in:
Mouse Reeve 2024-01-02 11:37:01 -08:00
parent d9a640c809
commit d6f7f76c4d
5 changed files with 24 additions and 105 deletions

View file

@ -15,7 +15,6 @@ from django.views import View
from csp.decorators import csp_update
from bookwyrm import models, settings
from bookwyrm.connectors.abstract_connector import get_data
from bookwyrm.utils import regex
@ -59,18 +58,11 @@ class Dashboard(View):
== site._meta.get_field("privacy_policy").get_default()
)
# check version
try:
release = get_data(settings.RELEASE_API, timeout=3)
available_version = release.get("tag_name", None)
if available_version and version.parse(available_version) > version.parse(
settings.VERSION
):
data["current_version"] = settings.VERSION
data["available_version"] = available_version
except: # pylint: disable= bare-except
pass
if site.available_version and version.parse(site.available_version) > version.parse(
settings.VERSION
):
data["current_version"] = settings.VERSION
data["available_version"] = site.available_version
return TemplateResponse(request, "settings/dashboard/dashboard.html", data)