diff --git a/media/css/core.css b/media/css/core.css index 5338130cf59..7d40d19b3dc 100644 --- a/media/css/core.css +++ b/media/css/core.css @@ -835,18 +835,25 @@ div.project-import-remote button.remote-sync:before { content: "\f021"; } -a.socialaccount-provider.github:before { +button.socialaccount-provider { + padding: 6px 10px 6px 10px; + font-size: 16px; + margin: 10px 5px 10px 0px; + line-height: 24px; +} + +button.socialaccount-provider.github:before { font-family: FontAwesome; content: "\f09b"; } -a.socialaccount-provider.gitlab:before { +button.socialaccount-provider.gitlab:before { font-family: FontAwesome; content: "\f296"; } -a.socialaccount-provider.bitbucket:before, -a.socialaccount-provider.bitbucket_oauth2:before { +button.socialaccount-provider.bitbucket:before, +button.socialaccount-provider.bitbucket_oauth2:before { font-family: FontAwesome; content: "\f171"; } diff --git a/readthedocs/projects/static-src/projects/css/import.less b/readthedocs/projects/static-src/projects/css/import.less index e25d166e66a..fbad24f1a2a 100644 --- a/readthedocs/projects/static-src/projects/css/import.less +++ b/readthedocs/projects/static-src/projects/css/import.less @@ -71,7 +71,7 @@ div.project-import-remote { overflow: auto; text-align: center; - a.socialaccount-provider { + button.socialaccount-provider { float: none; display: inline-block; margin-bottom: 0.5em; diff --git a/readthedocs/projects/static/projects/css/import.css b/readthedocs/projects/static/projects/css/import.css index 090e00b94cc..78471ad9a2d 100644 --- a/readthedocs/projects/static/projects/css/import.css +++ b/readthedocs/projects/static/projects/css/import.css @@ -60,7 +60,7 @@ div.project-import-remote ul.socialaccount_providers li { overflow: auto; text-align: center; } -div.project-import-remote ul.socialaccount_providers li a.socialaccount-provider { +div.project-import-remote ul.socialaccount_providers li button.socialaccount-provider { float: none; display: inline-block; margin-bottom: 0.5em; diff --git a/readthedocs/settings/base.py b/readthedocs/settings/base.py index c6ba5aedb1f..cd5dd5aa723 100644 --- a/readthedocs/settings/base.py +++ b/readthedocs/settings/base.py @@ -637,6 +637,7 @@ def DOCKER_LIMITS(self): ACCOUNT_AUTHENTICATION_METHOD = 'username_email' ACCOUNT_ACTIVATION_DAYS = 7 SOCIALACCOUNT_AUTO_SIGNUP = False + SOCIALACCOUNT_STORE_TOKENS = True SOCIALACCOUNT_PROVIDERS = { 'github': { 'SCOPE': [ diff --git a/readthedocs/templates/429.html b/readthedocs/templates/429.html new file mode 100644 index 00000000000..b7c79fd8c16 --- /dev/null +++ b/readthedocs/templates/429.html @@ -0,0 +1,28 @@ +{% extends "base.html" %} +{% load core_tags %} +{% load i18n %} + +{% block title %} + {% trans "Too many requests" %} +{% endblock %} + +{% block header-wrapper %} + {% include "error_header.html" %} +{% endblock %} + +{% block notify %}{% endblock %} + +{# Hide the language select form so we don't set a CSRF cookie #} +{% block language-select-form %}{% endblock %} + +{% block content %} +
+              .--~~,__
+ :-....,-------`~~'._.'
+  `-,,,  ,_      ;'~U'
+   _,-' ,'`-__; '--.
+  (_/'~~      ''''(;
+
+ Too many requests! Try again in a bit.
+
+{% endblock %} diff --git a/readthedocs/templates/account/base.html b/readthedocs/templates/account/base.html new file mode 100644 index 00000000000..94d9808cc76 --- /dev/null +++ b/readthedocs/templates/account/base.html @@ -0,0 +1 @@ +{% extends "base.html" %} diff --git a/readthedocs/templates/socialaccount/snippets/provider_list.html b/readthedocs/templates/socialaccount/snippets/provider_list.html index 7299538d04a..9839171a2e9 100644 --- a/readthedocs/templates/socialaccount/snippets/provider_list.html +++ b/readthedocs/templates/socialaccount/snippets/provider_list.html @@ -7,28 +7,30 @@ {% if provider.id == "openid" %} {% for brand in provider.get_brands %}
  • - - {% blocktrans trimmed with brand_name=brand.name verbiage=verbiage|default:'Connect to' %} - {{ verbiage }} {{ brand_name }} - {% endblocktrans %} - +
    + {% csrf_token %} + +
  • {% endfor %} {% endif %} {% if provider.id != 'bitbucket' %} {% if allowed_providers and provider.id in allowed_providers or not allowed_providers %}
  • - - {% blocktrans trimmed with provider_name=provider.name verbiage=verbiage|default:'Connect to' %} - {{ verbiage }} {{ provider_name }} - {% endblocktrans %} - +
    + {% csrf_token %} + +
  • {% endif %} {% endif %} diff --git a/requirements/pip.txt b/requirements/pip.txt index 3c0a4837dc7..24861bebe74 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -40,13 +40,7 @@ redis==3.5.3 # pyup: ignore celery==5.2.6 -# When upgrading to 0.43.0 we should double check the ``base.html`` change -# described in the changelog. In previous versions, the allauth app included a -# ``base.html`` template. This template could conflict with an equally named -# template at project level. Therefore, ``base.html`` has now been moved to -# ``account/base.html`` -- you will need to check your templates and likely -# override ``account/base.html`` within your project. -django-allauth==0.42.0 # pyup: ignore +django-allauth==0.50.0 requests-oauthlib==1.3.1 GitPython==3.1.27 diff --git a/tox.ini b/tox.ini index dc462d23c7e..31f09108dec 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,6 @@ setenv = LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 DJANGO_SETTINGS_SKIP_LOCAL=True - VIRTUALENV_SETUPTOOLS=58.3.0 passenv = CI TRAVIS TRAVIS_* HOME deps = -r requirements/testing.txt