Skip to content

Commit

Permalink
reload drf api settings to solve Swagger UI bug
Browse files Browse the repository at this point in the history
  • Loading branch information
to-sta committed Oct 18, 2023
1 parent 43230e2 commit 1aa46e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import dotenv
from django.core.management.utils import get_random_secret_key
from rest_framework import viewsets
from rest_framework.settings import api_settings

django_stubs_ext.monkeypatch(extra_classes=(viewsets.ModelViewSet,))
dotenv.load_dotenv()
Expand Down Expand Up @@ -157,3 +158,6 @@
"VERSION": "0.1.0",
"SERVE_INCLUDE_SCHEMA": False,
}

# Workaround #471 / monkeypatch() is overriding the REST_FRAMEWORK dict.
api_settings.reload()

0 comments on commit 1aa46e7

Please sign in to comment.