Skip to content

Commit 621e1f7

Browse files
authored
Add GITHUB_APP_NAME to context processor (#12511)
Needed for readthedocs/ext-theme#655, which otherwise I need to override the Allauth views for, and this seems useful in other places if we want to keep linking it.
1 parent 39e5c8c commit 621e1f7

File tree

5 files changed

+2
-9
lines changed

5 files changed

+2
-9
lines changed

readthedocs/core/context_processors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def readthedocs_processor(request):
2727
"SUPPORT_EMAIL": settings.SUPPORT_EMAIL,
2828
"PUBLIC_API_URL": settings.PUBLIC_API_URL,
2929
"ADMIN_URL": settings.ADMIN_URL,
30+
"GITHUB_APP_NAME": settings.GITHUB_APP_NAME,
3031
}
3132
return exports
3233

readthedocs/profiles/tests/test_views.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ def test_migration_page_initial_state(self, request):
256256

257257
assert context["step"] == "overview"
258258
assert context["step_connect_completed"] is False
259-
assert context["github_app_name"] == "readthedocs"
260259
assert list(context["migrated_projects"]) == []
261260
assert (
262261
context["old_application_link"]
@@ -344,7 +343,6 @@ def test_migration_page_step_connect_done(self, request):
344343

345344
assert context["step"] == "overview"
346345
assert context["step_connect_completed"] is True
347-
assert context["github_app_name"] == "readthedocs"
348346
assert list(context["migrated_projects"]) == []
349347
assert (
350348
context["old_application_link"]
@@ -437,7 +435,6 @@ def test_migration_page_step_install_done(self, request):
437435

438436
assert context["step"] == "overview"
439437
assert context["step_connect_completed"] is True
440-
assert context["github_app_name"] == "readthedocs"
441438
assert list(context["migrated_projects"]) == []
442439
assert (
443440
context["old_application_link"]
@@ -541,7 +538,6 @@ def test_migration_page_step_migrate_one_project(
541538

542539
assert context["step"] == "overview"
543540
assert context["step_connect_completed"] is True
544-
assert context["github_app_name"] == "readthedocs"
545541
assert list(context["migrated_projects"]) == [
546542
self.project_with_remote_repository,
547543
]
@@ -638,7 +634,6 @@ def test_migration_page_step_migrate_all_projects(
638634

639635
assert context["step"] == "overview"
640636
assert context["step_connect_completed"] is True
641-
assert context["github_app_name"] == "readthedocs"
642637
assert list(context["migrated_projects"]) == [
643638
self.project_with_remote_repository,
644639
self.project_with_remote_organization,
@@ -731,7 +726,6 @@ def test_migration_page_step_migrate_one_project_with_errors(
731726

732727
assert context["step"] == "overview"
733728
assert context["step_connect_completed"] is True
734-
assert context["github_app_name"] == "readthedocs"
735729
assert list(context["migrated_projects"]) == [
736730
self.project_with_remote_repository,
737731
]
@@ -824,7 +818,6 @@ def test_migration_page_step_revoke_done(self, request):
824818

825819
assert context["step"] == "overview"
826820
assert context["step_connect_completed"] is True
827-
assert context["github_app_name"] == "readthedocs"
828821
assert list(context["migrated_projects"]) == []
829822
assert (
830823
context["old_application_link"]

readthedocs/profiles/views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ def get_context_data(self, **kwargs):
348348
user = self.request.user
349349

350350
context["step_connect_completed"] = self._has_new_accounts_for_old_accounts()
351-
context["github_app_name"] = settings.GITHUB_APP_NAME
352351
context["migrated_projects"] = get_migrated_projects(user)
353352
context["old_application_link"] = get_old_app_link()
354353
context["step_revoke_completed"] = self._is_access_to_old_github_accounts_revoked()

readthedocs/projects/views/private.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ def get_context_data(self, **kwargs):
459459
context["allow_private_repos"] = settings.ALLOW_PRIVATE_REPOS
460460
context["form_automatic"] = ProjectAutomaticForm(user=self.request.user)
461461
context["form_manual"] = ProjectManualForm(user=self.request.user)
462-
context["GITHUB_APP_NAME"] = settings.GITHUB_APP_NAME
463462

464463
# Provider list for simple lookup of connected services, used for
465464
# conditional content

readthedocs/rtd_tests/tests/test_notifications.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class TestNotification(EmailNotification):
6262
"TEMPLATE_ROOT": mock.ANY,
6363
"USE_PROMOS": mock.ANY,
6464
"USE_ORGANIZATIONS": mock.ANY,
65+
"GITHUB_APP_NAME": mock.ANY,
6566
},
6667
)
6768

0 commit comments

Comments
 (0)