Skip to content

Commit

Permalink
add missing dependency for schema generation view
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrindt committed Aug 2, 2023
1 parent 2484753 commit 8a58c4e
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ that you can use to authenticate against the API endpoints described above.
Endpoints
---------

.. openapi:: ephios-open-api-schema.yml
.. openapi:: ephios-open-api-schema.yml
18 changes: 12 additions & 6 deletions ephios/api/urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.conf import settings
from django.urls import include, path
from oauth2_provider import views as oauth2_views
from rest_framework import routers
Expand All @@ -19,12 +20,6 @@

app_name = "api"
urlpatterns = [
path("", include(router.urls)),
path(
"schema/",
get_schema_view(title="ephios", description="ephios API", version="1.0.0"),
name="openapi-schema",
),
path(
"settings/",
include(
Expand Down Expand Up @@ -79,4 +74,15 @@
]
),
),
path(
"schema/",
get_schema_view(
title="ephios",
description="ephios API",
version=settings.EPHIOS_VERSION,
url=settings.GET_SITE_URL(),
),
name="openapi-schema",
),
path("", include(router.urls)),
]
2 changes: 1 addition & 1 deletion ephios/core/views/pwa.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_context_data(self, **kwargs):
context["offline_url"] = reverse("core:pwa_offline")
# Cache name: we serve /static/ files with a cache first strategy, so
# we need to use a new cache name when the static files change with a new ephios version.
context["cache_name"] = f"ephios-pwa-{settings.EPHIOS_VERSION}"
context["cache_name"] = f"ephios-pwa-v{settings.EPHIOS_VERSION}"
return context


Expand Down
2 changes: 1 addition & 1 deletion ephios/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
DEBUG = env.bool("DEBUG")
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS")

EPHIOS_VERSION = "v" + importlib_metadata.version("ephios")
EPHIOS_VERSION = importlib_metadata.version("ephios")

if not DEBUG:
SESSION_COOKIE_SECURE = True
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ redis = {version = "^4.3.4", optional = true}
django-oauth-toolkit = "^2.3.0"
mozilla-django-oidc = "^3.0.0"
urllib3 = "^1.26.0,<2.0.0" # pinned because of poetry issues with urllib3 2.0.0
pyyaml = "^6.0.1"

[tool.poetry.extras]
pgsql = ["psycopg2"]
Expand Down

0 comments on commit 8a58c4e

Please sign in to comment.