-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1368 from digitalfabrik/develop
Release `2022.4.2`
- Loading branch information
Showing
77 changed files
with
1,051 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import logging | ||
|
||
from django import forms | ||
from django.conf import settings | ||
from django.utils.text import capfirst | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from django.contrib.auth.forms import PasswordResetForm | ||
|
||
from ...utils.email_utils import send_mail | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class CustomPasswordResetForm(PasswordResetForm): | ||
""" | ||
A custom form to attach the logo to the password reset email | ||
""" | ||
|
||
email = forms.EmailField( | ||
label=_("Email"), | ||
max_length=254, | ||
widget=forms.EmailInput(attrs={"autocomplete": "email"}), | ||
) | ||
|
||
def send_mail( | ||
self, | ||
subject_template_name, | ||
email_template_name, | ||
context, | ||
from_email, | ||
to_email, | ||
html_email_template_name=None, | ||
): | ||
""" | ||
Send a django.core.mail.EmailMultiAlternatives to `to_email`. | ||
:param subject_template_name: The template to be used to render the subject of the email | ||
:type subject_template_name: str | ||
:param email_template_name: The template to be used to render the text email | ||
:type email_template_name: str | ||
:param context: The template context variables | ||
:type context: dict | ||
:param from_email: The email address of the sender | ||
:type from_email: str | ||
:param to_email: The email address of the recipient | ||
:type to_email: str | ||
:param html_email_template_name: The template to be used to render the HTML email | ||
:type html_email_template_name: str | ||
""" | ||
subject = f"{capfirst(settings.BRANDING)} - {_('Reset password')}" | ||
send_mail( | ||
subject, | ||
email_template_name, | ||
html_email_template_name, | ||
context, | ||
to_email, | ||
) | ||
logger.info( | ||
"A password reset link was sent to email %r.", | ||
to_email, | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 3.2.12 on 2022-04-23 12:26 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
""" | ||
This is the migration file for the timezones | ||
""" | ||
|
||
dependencies = [ | ||
("cms", "0016_region_tunews_enabled"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="region", | ||
name="timezone", | ||
field=models.CharField( | ||
default="Europe/Berlin", max_length=150, verbose_name="timezone" | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
integreat_cms/cms/templates/authentication/password_reset_email_subject.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.