Skip to content

Commit 4af9bee

Browse files
committed
disable GLOBAL_CONTEXT used by version upgrade banner as not all admin views accept extra_context kwarg
1 parent d2281ca commit 4af9bee

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

archivebox/core/urls.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88

99
from core.views import HomepageView, SnapshotView, PublicIndexView, AddView, HealthCheckView
1010

11-
from config import VERSION, VERSIONS_AVAILABLE, CAN_UPGRADE
11+
# GLOBAL_CONTEXT doesn't work as-is, disabled for now: https://github.com/ArchiveBox/ArchiveBox/discussions/1306
12+
# from config import VERSION, VERSIONS_AVAILABLE, CAN_UPGRADE
13+
# GLOBAL_CONTEXT = {'VERSION': VERSION, 'VERSIONS_AVAILABLE': VERSIONS_AVAILABLE, 'CAN_UPGRADE': CAN_UPGRADE}
1214

13-
# print('DEBUG', settings.DEBUG)
1415

15-
GLOBAL_CONTEXT = {'VERSION': VERSION, 'VERSIONS_AVAILABLE': VERSIONS_AVAILABLE, 'CAN_UPGRADE': CAN_UPGRADE}
16+
# print('DEBUG', settings.DEBUG)
1617

1718
urlpatterns = [
1819
path('public/', PublicIndexView.as_view(), name='public-index'),
@@ -33,7 +34,10 @@
3334

3435

3536
path('accounts/', include('django.contrib.auth.urls')),
36-
path('admin/', admin.site.urls, {'extra_context': GLOBAL_CONTEXT}),
37+
path('admin/', admin.site.urls),
38+
39+
# do not add extra_context like this as not all admin views (e.g. ModelAdmin.autocomplete_view accept extra kwargs)
40+
# path('admin/', admin.site.urls, {'extra_context': GLOBAL_CONTEXT}),
3741

3842
path('health/', HealthCheckView.as_view(), name='healthcheck'),
3943
path('error/', lambda _: 1/0),

0 commit comments

Comments
 (0)