Skip to content

Commit dcd37c5

Browse files
committed
New templates: remove TEMPLATE_ROOT setting and old template path
Simple way to tell Django to not use the templates from the `readthedocs/templates` directory without removing the files yet. This is a way to test that those files are not used. Related #12105
1 parent e11c7e2 commit dcd37c5

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

readthedocs/core/context_processors.py

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def readthedocs_processor(request):
2020
"GLOBAL_ANALYTICS_CODE": settings.GLOBAL_ANALYTICS_CODE,
2121
"DASHBOARD_ANALYTICS_CODE": settings.DASHBOARD_ANALYTICS_CODE,
2222
"SITE_ROOT": settings.SITE_ROOT + "/",
23-
"TEMPLATE_ROOT": settings.TEMPLATE_ROOT + "/",
2423
"DO_NOT_TRACK_ENABLED": settings.DO_NOT_TRACK_ENABLED,
2524
"USE_PROMOS": settings.USE_PROMOS,
2625
"USE_ORGANIZATIONS": settings.RTD_ALLOW_ORGANIZATIONS,

readthedocs/rtd_tests/tests/test_notifications.py

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class TestNotification(EmailNotification):
5959
"PUBLIC_API_URL": mock.ANY,
6060
"SITE_ROOT": mock.ANY,
6161
"SUPPORT_EMAIL": "support@readthedocs.org",
62-
"TEMPLATE_ROOT": mock.ANY,
6362
"USE_PROMOS": mock.ANY,
6463
"USE_ORGANIZATIONS": mock.ANY,
6564
},

readthedocs/settings/base.py

+6-11
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ def MIDDLEWARE(self):
379379
SITE_ROOT = os.path.dirname(
380380
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
381381
)
382-
TEMPLATE_ROOT = os.path.join(SITE_ROOT, "readthedocs", "templates")
383382
DOCROOT = os.path.join(SITE_ROOT, "user_builds")
384383
LOGS_ROOT = os.path.join(SITE_ROOT, "logs")
385384
PRODUCTION_ROOT = os.path.join(SITE_ROOT, "prod_artifacts")
@@ -413,16 +412,12 @@ def MIDDLEWARE(self):
413412

414413
@property
415414
def TEMPLATES(self):
416-
dirs = [self.TEMPLATE_ROOT]
417-
418-
if ext_theme:
419-
dirs.insert(
420-
0,
421-
os.path.join(
422-
os.path.dirname(readthedocsext.theme.__file__),
423-
"templates",
424-
),
425-
)
415+
dirs = [
416+
os.path.join(
417+
os.path.dirname(readthedocsext.theme.__file__),
418+
"templates",
419+
),
420+
]
426421

427422
# Disable ``cached.Loader`` on development
428423
# https://docs.djangoproject.com/en/4.2/ref/templates/api/#django.template.loaders.cached.Loader

0 commit comments

Comments
 (0)