Skip to content

Commit 57c46b3

Browse files
adamzappauloxnet
authored andcommitted
Simplied preview environment header check
As a follow-up to discussion in #2052, this patch uses a template-based check to show the preview banner instead of a context processor.
1 parent 121b547 commit 57c46b3

File tree

3 files changed

+1
-19
lines changed

3 files changed

+1
-19
lines changed

djangoproject/context_processors.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

djangoproject/settings/common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@
209209
"docs.context_processors.docs_version",
210210
"releases.context_processors.django_version",
211211
"aggregator.context_processors.community_stats",
212-
"djangoproject.context_processors.display_preview_banner",
213212
"django.template.context_processors.request",
214213
],
215214
},

djangoproject/templates/includes/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% if DISPLAY_PREVIEW_BANNER %}
1+
{% if 'preview.djangoproject.com' in request.get_host %}
22
<div class="copy-banner" style="background: #fff78e; padding: 10px;"></div>
33
{% endif %}
44
<header id="top">

0 commit comments

Comments
 (0)