From 366889c1d5ad4c29aa221f9a2c90ef98d261f3b5 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Tue, 27 Feb 2024 17:31:17 -0500 Subject: [PATCH 1/2] Allow override SOCIALACCOUNT_PROVIDERS from ops --- readthedocs/settings/base.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/readthedocs/settings/base.py b/readthedocs/settings/base.py index 95b3c1c9601..f3089e507bd 100644 --- a/readthedocs/settings/base.py +++ b/readthedocs/settings/base.py @@ -644,7 +644,7 @@ def DOCKER_LIMITS(self): SOCIALACCOUNT_AUTO_SIGNUP = False SOCIALACCOUNT_STORE_TOKENS = True - SOCIALACCOUNT_PROVIDERS = { + _SOCIALACCOUNT_PROVIDERS = { 'github': { "APPS": [ { @@ -696,6 +696,15 @@ def DOCKER_LIMITS(self): ], }, } + + def SOCIALACCOUNT_PROVIDERS(self): + """ + This is useful to override in a subclass, mainly to add the secrets when deploying. + + Our ops repos have a complex (shared) inheritance structure, so it's easier this way. + """ + return self._SOCIALACCOUNT_PROVIDERS + ACCOUNT_FORMS = { 'signup': 'readthedocs.forms.SignupFormWithNewsletter', } From 04210a9b99b3850419ae97facde9281e4d5433f7 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Tue, 27 Feb 2024 17:40:08 -0500 Subject: [PATCH 2/2] Property --- readthedocs/settings/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/readthedocs/settings/base.py b/readthedocs/settings/base.py index f3089e507bd..d984110448b 100644 --- a/readthedocs/settings/base.py +++ b/readthedocs/settings/base.py @@ -697,6 +697,7 @@ def DOCKER_LIMITS(self): }, } + @property def SOCIALACCOUNT_PROVIDERS(self): """ This is useful to override in a subclass, mainly to add the secrets when deploying.