From 3ccefbdb744cc692adad82de4941d6faa6b29aef Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 7 Jul 2018 21:29:44 +0200 Subject: [PATCH 1/2] Reorganize imports --- utils/forms.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/forms.py b/utils/forms.py index fe5dc282..6713f410 100644 --- a/utils/forms.py +++ b/utils/forms.py @@ -1,10 +1,11 @@ from django import forms -from .models import ContactMessage, BillingAddress, UserBillingAddress -from django.template.loader import render_to_string -from django.core.mail import EmailMultiAlternatives -from django.utils.translation import ugettext_lazy as _ from django.contrib.auth import authenticate +from django.core.mail import EmailMultiAlternatives +from django.template.loader import render_to_string +from django.utils.translation import ugettext_lazy as _ + from membership.models import CustomUser +from .models import ContactMessage, BillingAddress, UserBillingAddress # from utils.fields import CountryField From b580ac24f6a62f5bf25098ef4aa3c135454ce5e1 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 7 Jul 2018 21:30:40 +0200 Subject: [PATCH 2/2] Change string formatting --- utils/forms.py | 8 +++++--- utils/locale/de/LC_MESSAGES/django.po | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/utils/forms.py b/utils/forms.py index 6713f410..fdc67d26 100644 --- a/utils/forms.py +++ b/utils/forms.py @@ -67,7 +67,8 @@ class ResendActivationEmailForm(forms.Form): try: c = CustomUser.objects.get(email=email) if c.validated == 1: - raise forms.ValidationError(_("The account is already active.")) + raise forms.ValidationError( + _("The account is already active.")) return email except CustomUser.DoesNotExist: raise forms.ValidationError(_("User does not exist")) @@ -157,8 +158,9 @@ class BillingAddressFormSignup(BillingAddressForm): try: CustomUser.objects.get(email=email) raise forms.ValidationError( - _("The email {} is already registered with us. Please reset " - "your password and access your account.".format(email)) + _("The email %(email)s is already registered with us. " + "Please reset your password and access your account.") % + {'email': email} ) except CustomUser.DoesNotExist: return email diff --git a/utils/locale/de/LC_MESSAGES/django.po b/utils/locale/de/LC_MESSAGES/django.po index 6313dfb8..670e15b9 100644 --- a/utils/locale/de/LC_MESSAGES/django.po +++ b/utils/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-05 23:18+0000\n" +"POT-Creation-Date: 2018-07-07 19:27+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -781,10 +781,10 @@ msgid "Email" msgstr "E-Mail" msgid "" -"The email {} is already registered with us. Please reset your password and " -"access your account." +"The email %(email)s is already registered with us. Please reset your " +"password and access your account." msgstr "" -"Diese E-Mail-Adresse {} existiert bereits. Bitte setze dein Passwort zurück " +"Diese E-Mail-Adresse %(email)s existiert bereits. Bitte setze dein Passwort zurück " "auf dein Konto zuzugreifen." msgid "Street Building"