Skip to content

Commit

Permalink
templates,deps: allauth v.62.0
Browse files Browse the repository at this point in the history
  • Loading branch information
m4ra authored and goapunk committed May 30, 2024
1 parent ca137bb commit b82ead1
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 4 deletions.
4 changes: 2 additions & 2 deletions adhocracy-plus/config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"allauth",
"allauth.account",
"allauth.socialaccount",
"allauth.socialaccount.providers.dummy",
"rules.apps.AutodiscoverRulesConfig",
"easy_thumbnails",
"parler",
Expand Down Expand Up @@ -284,8 +285,7 @@
"signup": "apps.users.forms.DefaultSignupForm",
"login": "apps.users.forms.DefaultLoginForm",
}
ACCOUNT_LOGIN_ATTEMPTS_LIMIT = 10
ACCOUNT_LOGIN_ATTEMPTS_TIMEOUT = 300 # seconds
ACCOUNT_RATE_LIMITS = {"login_failed": "10/5m/ip"}
ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION = True
ACCOUNT_LOGIN_ON_PASSWORD_RESET = True
ACCOUNT_USERNAME_MIN_LENGTH = 5
Expand Down
19 changes: 19 additions & 0 deletions adhocracy-plus/templates/account/password_reset_done.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% extends "account/base.html" %}

{% load i18n %}
{% load allauth %}
{% load account %}

{% block head_title %}
{% translate "Password Reset" %}
{% endblock head_title %}

{% block content %}
<h1>{% translate "Password Reset" %}</h1>
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}
<p>
{% blocktranslate %}We have sent you an e-mail. If you have not received it please check your spam folder. Otherwise contact us if you do not receive it in a few minutes.{% endblocktranslate %}
</p>
{% endblock content %}
12 changes: 12 additions & 0 deletions adhocracy-plus/templates/account/verification_sent.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "account/base.html" %}
{% load i18n %}
{% load allauth %}
{% block head_title %}
{% translate "Verify Your E-mail Address" %}
{% endblock head_title %}
{% block content %}
<h1>{% translate "Verify Your E-mail Address" %}</h1>
<p>
{% blocktranslate %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. If you do not see the verification e-mail in your main inbox, check your spam folder. Please contact us if you do not receive the verification e-mail within a few minutes.{% endblocktranslate %}
</p>
{% endblock content %}
28 changes: 28 additions & 0 deletions adhocracy-plus/templates/dummy/authenticate_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{% extends "account/base.html" %}
{% load i18n %}
{% load allauth %}
{% block head_title %}
{% translate "Dummy Provider Login" %}
{% endblock head_title %}
{% block content %}
{% element form form=form method="post" action=action_url %}
{% csrf_token %}
{% slot body %}
{% csrf_token %}
{% element fields form=form %}
{% endelement %}
{% endslot %}
{% slot actions %}
{% element button type="submit" %}
{% translate "Login" %}
{% endelement %}
{% element button form="cancel-form" type="submit" %}
{% translate "Cancel" %}
{% endelement %}
{% endslot %}
{% endelement %}
<form id="cancel-form" method="post" action="{{ action_url }}">
{% csrf_token %}
<input type="hidden" name="action" value="cancel" />
</form>
{% endblock %}
12 changes: 12 additions & 0 deletions adhocracy-plus/templates/socialaccount/authentication_error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "account/base.html" %}
{% load i18n %}
{% load allauth %}
{% block head_title %}
{% trans "Third-Party Login Failure" %}
{% endblock head_title %}
{% block content %}
{% element h1 %}
{% trans "Third-Party Login Failure" %}
{% endelement %}
<p>{% trans "An error occurred while attempting to login via your third-party account." %}</p>
{% endblock content %}
31 changes: 31 additions & 0 deletions adhocracy-plus/templates/socialaccount/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{% extends "account/base.html" %}
{% load i18n %}
{% load allauth %}
{% block head_title %}
{% trans "Sign In" %}
{% endblock head_title %}
{% block content %}
{% if process == "connect" %}
{% element h1 %}
{% blocktrans with provider.name as provider %}Connect {{ provider }}{% endblocktrans %}
{% endelement %}
<p>
{% blocktrans with provider.name as provider %}You are about to connect a new third-party account from {{ provider }}.{% endblocktrans %}
</p>
{% else %}
{% element h1 %}
{% blocktrans with provider.name as provider %}Sign In Via {{ provider }}{% endblocktrans %}
{% endelement %}
<p>
{% blocktrans with provider.name as provider %}You are about to sign in using a third-party account from {{ provider }}.{% endblocktrans %}
</p>
{% endif %}
{% element form method="post" no_visible_fields=True %}
{% slot actions %}
{% csrf_token %}
{% element button type="submit" %}
{% trans "Continue" %}
{% endelement %}
{% endslot %}
{% endelement %}
{% endblock content %}
2 changes: 1 addition & 1 deletion adhocracy-plus/templates/socialaccount/signup.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "socialaccount/base.html" %}
{% extends "account/base.html" %}

{% load i18n %}

Expand Down
3 changes: 3 additions & 0 deletions changelog/8102.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

- unique email constraint
- add social account autoconnect to enable social account email connecting to existing regular account
- add templates for email verification, password reset, socialaccount login, authentication error, and dummy authentication to address the template changes of allauth v.0.58.0
- remove deprecated settings for account rate limits (removed in allauth v.0.61.0
- update to allauth v.0.62.0
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ redis==5.0.4

# Inherited a4-core requirements
Django==4.2.13
django-allauth==0.57.0
django-allauth==0.62.0
git+https://github.com/liqd/django-autoslug.git@liqd2212#egg=django-autoslug
django-ckeditor==6.7.1
https://github.com/liqd/django-ckeditor-5/releases/download/v0.2.12-liqd/django_ckeditor_5-0.2.12-py3-none-any.whl
Expand Down

0 comments on commit b82ead1

Please sign in to comment.