Skip to content

Commit b6634f6

Browse files
committed
Re-added context processor I removed...
1 parent c767e8d commit b6634f6

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from django.conf import settings
2+
from django.http import HttpRequest
3+
4+
5+
def google_oauth2_client_id(request: HttpRequest) -> dict[str, str]:
6+
"""
7+
Adds the OAuth app client ID to the context, for the popup on the core template.
8+
9+
:param request: The current request.
10+
:return: A dict with the client ID in, for template rendering.
11+
"""
12+
return {
13+
"GOOGLE_OAUTH2_CLIENT_ID": settings.GOOGLE_OAUTH2_CLIENT_ID,
14+
}

iommi_demo/core/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"APP_DIRS": True,
4646
"OPTIONS": {
4747
"context_processors": [
48+
"app.context_processors.google_oauth2_client_id",
4849
"django.template.context_processors.debug",
4950
"django.template.context_processors.request",
5051
"django.contrib.auth.context_processors.auth",

0 commit comments

Comments
 (0)