diff --git a/readthedocs/oauth/services/gitlab.py b/readthedocs/oauth/services/gitlab.py index 1af481193d0..ee809f92efb 100644 --- a/readthedocs/oauth/services/gitlab.py +++ b/readthedocs/oauth/services/gitlab.py @@ -35,7 +35,7 @@ class GitLabService(Service): # Just use the network location to determine if it's a GitLab project # because private repos have another base url, eg. git@gitlab.example.com url_pattern = re.compile( - re.escape(urlparse(adapter.provider_base_url).netloc), + re.escape(urlparse(adapter.provider_default_url).netloc), ) PERMISSION_NO_ACCESS = 0 @@ -73,7 +73,7 @@ def sync_repositories(self): remote_repositories = [] try: repos = self.paginate( - "{url}/api/v4/projects".format(url=self.adapter.provider_base_url), + "{url}/api/v4/projects".format(url=self.adapter.provider_default_url), per_page=100, archived=False, order_by="path", @@ -100,7 +100,7 @@ def sync_organizations(self): try: orgs = self.paginate( - "{url}/api/v4/groups".format(url=self.adapter.provider_base_url), + "{url}/api/v4/groups".format(url=self.adapter.provider_default_url), per_page=100, all_available=False, order_by="path", @@ -110,7 +110,7 @@ def sync_organizations(self): remote_organization = self.create_organization(org) org_repos = self.paginate( "{url}/api/v4/groups/{id}/projects".format( - url=self.adapter.provider_base_url, + url=self.adapter.provider_default_url, id=org["id"], ), per_page=100, @@ -131,7 +131,7 @@ def sync_organizations(self): # which contains the admin permission fields. resp = self.get_session().get( "{url}/api/v4/projects/{id}".format( - url=self.adapter.provider_base_url, id=repo["id"] + url=self.adapter.provider_default_url, id=repo["id"] ) ) @@ -270,7 +270,7 @@ def create_organization(self, fields): organization.name = fields.get("name") organization.slug = fields.get("path") organization.url = "{url}/{path}".format( - url=self.adapter.provider_base_url, + url=self.adapter.provider_default_url, path=fields.get("path"), ) organization.avatar_url = fields.get("avatar_url") @@ -336,7 +336,7 @@ def get_provider_data(self, project, integration): try: resp = session.get( "{url}/api/v4/projects/{repo_id}/hooks".format( - url=self.adapter.provider_base_url, + url=self.adapter.provider_default_url, repo_id=repo_id, ), ) @@ -383,7 +383,7 @@ def setup_webhook(self, project, integration=None): ) repo_id = self._get_repo_id(project) - url = f"{self.adapter.provider_base_url}/api/v4/projects/{repo_id}/hooks" + url = f"{self.adapter.provider_default_url}/api/v4/projects/{repo_id}/hooks" if repo_id is None: return (False, resp) @@ -462,7 +462,7 @@ def update_webhook(self, project, integration): hook_id = provider_data.get("id") resp = session.put( "{url}/api/v4/projects/{repo_id}/hooks/{hook_id}".format( - url=self.adapter.provider_base_url, + url=self.adapter.provider_default_url, repo_id=repo_id, hook_id=hook_id, ), @@ -537,7 +537,7 @@ def send_build_status(self, build, commit, status): "description": description, "context": context, } - url = f"{self.adapter.provider_base_url}/api/v4/projects/{repo_id}/statuses/{commit}" + url = f"{self.adapter.provider_default_url}/api/v4/projects/{repo_id}/statuses/{commit}" log.bind( project_slug=project.slug, diff --git a/readthedocs/rtd_tests/tests/test_celery.py b/readthedocs/rtd_tests/tests/test_celery.py index 54df2b23db6..b64e91233fe 100644 --- a/readthedocs/rtd_tests/tests/test_celery.py +++ b/readthedocs/rtd_tests/tests/test_celery.py @@ -149,7 +149,7 @@ def test_send_build_status_no_remote_repo_or_social_account_github( notification.format_values, { "provider_name": "GitHub", - "url_connect_account": "/accounts/social/connections/", + "url_connect_account": "/accounts/3rdparty/", }, ) @@ -222,6 +222,6 @@ def test_send_build_status_no_remote_repo_or_social_account_gitlab( notification.format_values, { "provider_name": "GitLab", - "url_connect_account": "/accounts/social/connections/", + "url_connect_account": "/accounts/3rdparty/", }, ) diff --git a/readthedocs/settings/base.py b/readthedocs/settings/base.py index d4be93bbfa9..1597a493abc 100644 --- a/readthedocs/settings/base.py +++ b/readthedocs/settings/base.py @@ -285,7 +285,6 @@ def INSTALLED_APPS(self): # noqa "allauth.socialaccount", "allauth.socialaccount.providers.github", "allauth.socialaccount.providers.gitlab", - "allauth.socialaccount.providers.bitbucket", "allauth.socialaccount.providers.bitbucket_oauth2", "cacheops", ] @@ -698,12 +697,6 @@ def DOCKER_LIMITS(self): ], # Bitbucket scope/permissions are determined by the Oauth consumer setup on bitbucket.org. }, - # Deprecated, we use `bitbucket_oauth2` for all new connections. - "bitbucket": { - "APPS": [ - {"client_id": "123", "secret": "456", "key": ""}, - ], - }, } @property diff --git a/readthedocs/templates/account/login.html b/readthedocs/templates/account/login.html index 997a01eded3..056b1abac1a 100644 --- a/readthedocs/templates/account/login.html +++ b/readthedocs/templates/account/login.html @@ -1,4 +1,4 @@ -{% extends "account/base.html" %} +{% extends "account/base_entrance.html" %} {% load i18n %} {% load account %} diff --git a/readthedocs/templates/account/signup.html b/readthedocs/templates/account/signup.html index 34aa2d85b6e..5a1df523da4 100644 --- a/readthedocs/templates/account/signup.html +++ b/readthedocs/templates/account/signup.html @@ -1,4 +1,4 @@ -{% extends "account/base.html" %} +{% extends "account/base_entrance.html" %} {% load i18n %} diff --git a/readthedocs/templates/account/base.html b/readthedocs/templates/allauth/layouts/base.html similarity index 100% rename from readthedocs/templates/account/base.html rename to readthedocs/templates/allauth/layouts/base.html diff --git a/readthedocs/templates/socialaccount/authentication_error.html b/readthedocs/templates/socialaccount/authentication_error.html index b2ab6fe6ac3..6bec8055b6f 100644 --- a/readthedocs/templates/socialaccount/authentication_error.html +++ b/readthedocs/templates/socialaccount/authentication_error.html @@ -1,4 +1,4 @@ -{% extends "socialaccount/base.html" %} +{% extends "socialaccount/base_entrance.html" %} {% load i18n %} diff --git a/readthedocs/templates/socialaccount/snippets/provider_list.html b/readthedocs/templates/socialaccount/snippets/provider_list.html index f1cdcd125d5..e5a2fc35632 100644 --- a/readthedocs/templates/socialaccount/snippets/provider_list.html +++ b/readthedocs/templates/socialaccount/snippets/provider_list.html @@ -6,10 +6,9 @@ {% for provider in socialaccount_providers %} {% comment %} - OpenID is not implemented. - - Bitbucket is deprecated (in favor of their new oauth implementation). - SAML is handled in another view, we don't want to list all SAML integrations here. {% endcomment %} - {% if provider.id != 'bitbucket' and provider.id != 'saml' %} + {% if provider.id != 'saml' %} {% if allowed_providers and provider.id in allowed_providers or not allowed_providers %}