From 58e7a2aca797250cf6b42937241e1766d359ee09 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 29 Aug 2017 17:48:41 +0530 Subject: [PATCH] saving cardholder name --- hosting/locale/de/LC_MESSAGES/django.po | 10 +++------- hosting/templates/hosting/settings.html | 4 +--- utils/forms.py | 17 +++++++++++------ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index d46b33d1..6056dc15 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -330,20 +330,16 @@ msgstr "Deine Kreditkartennummer" msgid "Reset your password" msgstr "Passwort zurücksetzen" -#, fuzzy -#| msgid "VM Settings" msgid "My Settings" -msgstr "VM Einstellungen" +msgstr "Meine Einstellungen" msgid "Last" msgstr "" -#, fuzzy -#| msgid "Card Type" msgid "Type" msgstr "Kartentyp" -msgid "No Cards found for your account." +msgid "Add a new Card." msgstr "" msgid "Add your public SSH key" @@ -508,7 +504,7 @@ msgstr "Bestellung Bestätigen" msgid "" "We could not find the requested VM. Please " "contact Data Center Light Support." -msgstr "" +msgstr "Kontaktiere den Data Center Light Support." #~ msgid "" #~ "\n" diff --git a/hosting/templates/hosting/settings.html b/hosting/templates/hosting/settings.html index 130234db..11283b94 100644 --- a/hosting/templates/hosting/settings.html +++ b/hosting/templates/hosting/settings.html @@ -34,8 +34,7 @@
{% trans "Type" %}: {{credit_card_data.cc_brand}}
{% else %} -

{% trans "No Cards found for your account." %}

- {% comment %} +

{% trans "Add a new Card." %}

@@ -92,7 +91,6 @@

- {% endcomment %} {% endif %} diff --git a/utils/forms.py b/utils/forms.py index 7d9d20c0..c3f3b6db 100644 --- a/utils/forms.py +++ b/utils/forms.py @@ -41,7 +41,8 @@ class LoginFormMixin(forms.Form): password = self.cleaned_data.get('password') is_auth = authenticate(email=email, password=password) if not is_auth: - raise forms.ValidationError("Your username and/or password were incorrect.") + raise forms.ValidationError( + "Your username and/or password were incorrect.") return self.cleaned_data def clean_email(self): @@ -101,7 +102,8 @@ class BillingAddressForm(forms.ModelForm): class Meta: model = BillingAddress - fields = ['cardholder_name', 'street_address', 'city', 'postal_code', 'country'] + fields = ['cardholder_name', 'street_address', + 'city', 'postal_code', 'country'] labels = { 'cardholder_name': _('Cardholder Name'), 'street_address': _('Street Address'), @@ -117,9 +119,10 @@ class UserBillingAddressForm(forms.ModelForm): class Meta: model = UserBillingAddress - # cardholder name not saved - fields = ['street_address', 'city', 'postal_code', 'country', 'user'] + fields = ['cardholder_name', 'street_address', + 'city', 'postal_code', 'country', 'user'] labels = { + 'cardholder_name': _('Cardholder Name'), 'street_address': _('Street Building'), 'city': _('City'), 'postal_code': _('Postal Code'), @@ -147,8 +150,10 @@ class ContactUsForm(forms.ModelForm): } def send_email(self, email_to='info@digitalglarus.ch'): - text_content = render_to_string('emails/contact.txt', {'data': self.cleaned_data}) - html_content = render_to_string('emails/contact.html', {'data': self.cleaned_data}) + text_content = render_to_string( + 'emails/contact.txt', {'data': self.cleaned_data}) + html_content = render_to_string( + 'emails/contact.html', {'data': self.cleaned_data}) email = EmailMultiAlternatives('Subject', text_content) email.attach_alternative(html_content, "text/html") email.to = [email_to]