Skip to content

Commit 5bc5ddf

Browse files
committed
Fix admin autocomplete modals not working with extra_context
1 parent 4fe17f5 commit 5bc5ddf

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tilavarauspalvelu/urls.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
from api.legacy_rest_api.urls import legacy_outer
99
from api.webhooks.urls import webhook_router
1010

11+
# Mock the autocomplete view to be able to include `extra_context` for other pages
12+
real_autocomplete_view = admin.site.autocomplete_view
13+
admin.site.autocomplete_view = lambda request, extra_context: real_autocomplete_view(request)
14+
1115
urlpatterns = [
1216
path("graphql/", csrf_exempt(FileUploadGraphQLView.as_view(graphiql=settings.DEBUG))), # NOSONAR
1317
path("admin/", admin.site.urls, {"extra_context": {"version": settings.APP_VERSION}}),

0 commit comments

Comments
 (0)