Commit 9657cf64 authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Merge branch '452-valideer-dat-mensen-met-automatische-incasso-een-iban-hebben' into 'master'

Prevent setting automatic member payment fees to true without an IBAN.

Closes #452

See merge request !587
parents 8a5cc220 3fff0ae1
...@@ -31,6 +31,7 @@ class ProfileInline(admin.StackedInline): ...@@ -31,6 +31,7 @@ class ProfileInline(admin.StackedInline):
'emergency_contact_phone_number', 'language', 'emergency_contact_phone_number', 'language',
'event_permissions') 'event_permissions')
model = models.Profile model = models.Profile
form = forms.ProfileForm
can_delete = False can_delete = False
......
...@@ -23,6 +23,17 @@ class ProfileForm(forms.ModelForm): ...@@ -23,6 +23,17 @@ class ProfileForm(forms.ModelForm):
'receive_optin', 'receive_newsletter'] 'receive_optin', 'receive_newsletter']
model = Profile model = Profile
def clean(self):
super().clean()
errors = {}
direct_debit_authorized = self.cleaned_data\
.get('direct_debit_authorized')
bank_account = self.cleaned_data.get('bank_account')
if direct_debit_authorized and not bank_account:
errors.update({'bank_account': _('Please enter a bank account')})
raise forms.ValidationError(errors)
class UserCreationForm(BaseUserCreationForm): class UserCreationForm(BaseUserCreationForm):
# Don't forget to edit the formset in admin.py! # Don't forget to edit the formset in admin.py!
......
...@@ -7,8 +7,8 @@ msgid "" ...@@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-10-13 16:01+0200\n" "POT-Creation-Date: 2017-10-18 21:31+0200\n"
"PO-Revision-Date: 2017-09-20 21:10+0200\n" "PO-Revision-Date: 2017-10-18 21:32+0200\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n" "Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: nl\n" "Language: nl\n"
...@@ -16,61 +16,61 @@ msgstr "" ...@@ -16,61 +16,61 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.3\n" "X-Generator: Poedit 2.0.4\n"
#: admin.py:38 #: admin.py:39
msgid "membership type" msgid "membership type"
msgstr "lidtype" msgstr "lidtype"
#: admin.py:56 #: admin.py:57
msgid "Age" msgid "Age"
msgstr "Leeftijd" msgstr "Leeftijd"
#: admin.py:61 #: admin.py:62
msgid "≥ 18" msgid "≥ 18"
msgstr "≥ 18" msgstr "≥ 18"
#: admin.py:62 #: admin.py:63
msgid "< 18" msgid "< 18"
msgstr "< 18" msgstr "< 18"
#: admin.py:63 #: admin.py:64
msgid "Unknown" msgid "Unknown"
msgstr "Onbekend" msgstr "Onbekend"
#: admin.py:111 admin.py:130 #: admin.py:112 admin.py:131
msgid "First name" msgid "First name"
msgstr "Voornaam" msgstr "Voornaam"
#: admin.py:111 admin.py:130 #: admin.py:112 admin.py:131
msgid "Last name" msgid "Last name"
msgstr "Achternaam" msgstr "Achternaam"
#: admin.py:111 #: admin.py:112
msgid "Address" msgid "Address"
msgstr "Adres" msgstr "Adres"
#: admin.py:112 #: admin.py:113
msgid "Address line 2" msgid "Address line 2"
msgstr "Tweede adresregel" msgstr "Tweede adresregel"
#: admin.py:112 models.py:189 #: admin.py:113 models.py:202
msgid "Postal code" msgid "Postal code"
msgstr "Postcode" msgstr "Postcode"
#: admin.py:112 models.py:195 #: admin.py:113 models.py:208
msgid "City" msgid "City"
msgstr "Woonplaats" msgstr "Woonplaats"
#: admin.py:122 #: admin.py:123
msgid "Download address label for selected users" msgid "Download address label for selected users"
msgstr "Download adreslabels voor geselecteerde gebruikers" msgstr "Download adreslabels voor geselecteerde gebruikers"
#: admin.py:130 models.py:152 #: admin.py:131 models.py:165
msgid "Student number" msgid "Student number"
msgstr "Studentnummer" msgstr "Studentnummer"
#: admin.py:137 #: admin.py:138
msgid "Download student number label for selected users" msgid "Download student number label for selected users"
msgstr "Download studentnummers voor geselecteerde gebruikers" msgstr "Download studentnummers voor geselecteerde gebruikers"
...@@ -98,95 +98,99 @@ msgstr "Verlopen lidmaatschap" ...@@ -98,95 +98,99 @@ msgstr "Verlopen lidmaatschap"
msgid "Membership expiration announcement sent" msgid "Membership expiration announcement sent"
msgstr "Meldingen vervallen lidmaatschap verzonden" msgstr "Meldingen vervallen lidmaatschap verzonden"
#: forms.py:42 #: forms.py:33
msgid "Please enter a bank account"
msgstr "Voer een bankrekening in"
#: forms.py:53
msgid "Send welcome email" msgid "Send welcome email"
msgstr "Stuur welkomste-mails" msgstr "Stuur welkomste-mails"
#: forms.py:43 #: forms.py:54
msgid "This email will include the generated password" msgid "This email will include the generated password"
msgstr "Deze e-mail zal het gegenereerde wachtwoord bevatten" msgstr "Deze e-mail zal het gegenereerde wachtwoord bevatten"
#: forms.py:75 #: forms.py:86
msgid "Welcome to Study Association Thalia" msgid "Welcome to Study Association Thalia"
msgstr "Welkom bij Studievereniging Thalia" msgstr "Welkom bij Studievereniging Thalia"
#: models.py:99 #: models.py:110
msgid "Is this user currently active" msgid "Is this user currently active"
msgstr "Is deze user op dit moment actief" msgstr "Is deze user op dit moment actief"
#: models.py:133 #: models.py:144
msgid "Computing Science" msgid "Computing Science"
msgstr "Informatica" msgstr "Informatica"
#: models.py:134 #: models.py:145
msgid "Information Sciences" msgid "Information Sciences"
msgstr "Informatiekunde" msgstr "Informatiekunde"
#: models.py:146 templates/members/profile.html:40 #: models.py:159 templates/members/profile.html:40
msgid "Study programme" msgid "Study programme"
msgstr "Studie" msgstr "Studie"
#: models.py:156 #: models.py:169
msgid "Enter a valid student- or e/z/u-number." msgid "Enter a valid student- or e/z/u-number."
msgstr "Voer een geldig student- of e/z/u-nummer in." msgstr "Voer een geldig student- of e/z/u-nummer in."
#: models.py:162 #: models.py:175
msgid "Starting year" msgid "Starting year"
msgstr "Startjaar" msgstr "Startjaar"
#: models.py:163 #: models.py:176
msgid "The year this member started studying." msgid "The year this member started studying."
msgstr "Het jaar waarop dit lid begon met studeren." msgstr "Het jaar waarop dit lid begon met studeren."
#: models.py:174 #: models.py:187
msgid "Include the house number" msgid "Include the house number"
msgstr "Inclusief huisnummer" msgstr "Inclusief huisnummer"
#: models.py:176 #: models.py:189
msgid "Street and house number" msgid "Street and house number"
msgstr "Straat en huisnummer" msgstr "Straat en huisnummer"
#: models.py:182 #: models.py:195
msgid "Second address line" msgid "Second address line"
msgstr "Tweede adresregel" msgstr "Tweede adresregel"
#: models.py:201 #: models.py:214
msgid "Phone number" msgid "Phone number"
msgstr "Telefoonnummer" msgstr "Telefoonnummer"
#: models.py:202 #: models.py:215
msgid "Enter a phone number so Thalia may reach you" msgid "Enter a phone number so Thalia may reach you"
msgstr "Voer een telefoonnummer in zodat Thalia je kan bereiken" msgstr "Voer een telefoonnummer in zodat Thalia je kan bereiken"
#: models.py:205 models.py:227 #: models.py:218 models.py:240
msgid "Please enter a valid phone number" msgid "Please enter a valid phone number"
msgstr "Voer svp een geldig telefoonnummer in" msgstr "Voer svp een geldig telefoonnummer in"
#: models.py:215 #: models.py:228
msgid "Emergency contact name" msgid "Emergency contact name"
msgstr "Contact voor noodgevallen" msgstr "Contact voor noodgevallen"
#: models.py:216 #: models.py:229
msgid "Who should we contact in case of emergencies" msgid "Who should we contact in case of emergencies"
msgstr "Wie Thalia moet bereiken in bij noodgevallen" msgstr "Wie Thalia moet bereiken in bij noodgevallen"
#: models.py:223 #: models.py:236
msgid "Emergency contact phone number" msgid "Emergency contact phone number"
msgstr "Telefoonnummer noodcontact" msgstr "Telefoonnummer noodcontact"
#: models.py:224 #: models.py:237
msgid "The phone number for the emergency contact" msgid "The phone number for the emergency contact"
msgstr "Het telefoonummer van de noodcontact" msgstr "Het telefoonummer van de noodcontact"
#: models.py:236 templates/members/profile.html:47 #: models.py:249 templates/members/profile.html:47
msgid "Birthday" msgid "Birthday"
msgstr "Verjaardag" msgstr "Verjaardag"
#: models.py:241 #: models.py:254
msgid "Display birthday" msgid "Display birthday"
msgstr "Laat verjaardag zien" msgstr "Laat verjaardag zien"
#: models.py:243 #: models.py:256
msgid "" msgid ""
"Show your birthday to other members on your profile page and in the birthday " "Show your birthday to other members on your profile page and in the birthday "
"calendar" "calendar"
...@@ -194,107 +198,107 @@ msgstr "" ...@@ -194,107 +198,107 @@ msgstr ""
"Toon je verjaardag aan andere leden op je profielpagina en in de " "Toon je verjaardag aan andere leden op je profielpagina en in de "
"verjaardagskalender" "verjaardagskalender"
#: models.py:250 templates/members/profile.html:43 #: models.py:263 templates/members/profile.html:43
msgid "Website" msgid "Website"
msgstr "Website" msgstr "Website"
#: models.py:251 #: models.py:264
msgid "Website to display on your profile page" msgid "Website to display on your profile page"
msgstr "Website om op je profiel te linken" msgstr "Website om op je profiel te linken"
#: models.py:257 #: models.py:270
msgid "Profile text" msgid "Profile text"
msgstr "Profieltekst" msgstr "Profieltekst"
#: models.py:258 #: models.py:271
msgid "Text to display on your profile" msgid "Text to display on your profile"
msgstr "Tekst om te laten zien op je profielpagina" msgstr "Tekst om te laten zien op je profielpagina"
#: models.py:265 #: models.py:278
msgid "Initials" msgid "Initials"
msgstr "Initialen" msgstr "Initialen"
#: models.py:272 #: models.py:285
msgid "Nickname" msgid "Nickname"
msgstr "Bijnaam" msgstr "Bijnaam"
#: models.py:279 #: models.py:292
msgid "How to display name" msgid "How to display name"
msgstr "Weergave naam" msgstr "Weergave naam"
#: models.py:280 #: models.py:293
msgid "Show full name" msgid "Show full name"
msgstr "Volledige naam" msgstr "Volledige naam"
#: models.py:281 #: models.py:294
msgid "Show only nickname" msgid "Show only nickname"
msgstr "Alleen initialen" msgstr "Alleen initialen"
#: models.py:282 #: models.py:295
msgid "Show only first name" msgid "Show only first name"
msgstr "Alleen voornaam" msgstr "Alleen voornaam"
#: models.py:283 #: models.py:296
msgid "Show initials and last name" msgid "Show initials and last name"
msgstr "Alleen initialen en achternaam" msgstr "Alleen initialen en achternaam"
#: models.py:284 #: models.py:297
msgid "Show name like \"John 'nickname' Doe\"" msgid "Show name like \"John 'nickname' Doe\""
msgstr "Laat zien als \"John 'bijnaam' Doe\"" msgstr "Laat zien als \"John 'bijnaam' Doe\""
#: models.py:285 #: models.py:298
msgid "Show nickname and last name" msgid "Show nickname and last name"
msgstr "Laat bijnaam en achternaam zien" msgstr "Laat bijnaam en achternaam zien"
#: models.py:290 #: models.py:303
msgid "Photo" msgid "Photo"
msgstr "Foto" msgstr "Foto"
#: models.py:298 #: models.py:311
msgid "Which events can this member attend" msgid "Which events can this member attend"
msgstr "Welke evenementen mag dit lid bijwonen" msgstr "Welke evenementen mag dit lid bijwonen"
#: models.py:299 #: models.py:312
msgid "All events" msgid "All events"
msgstr "Alle evenementen" msgstr "Alle evenementen"
#: models.py:300 #: models.py:313
msgid "User may not attend events" msgid "User may not attend events"
msgstr "Gebruiker mag niet naar evenementen" msgstr "Gebruiker mag niet naar evenementen"
#: models.py:301 #: models.py:314
msgid "User may not attend drinks" msgid "User may not attend drinks"
msgstr "Gebruiker mag niet naar borrels" msgstr "Gebruiker mag niet naar borrels"
#: models.py:302 #: models.py:315
msgid "User may not attend anything" msgid "User may not attend anything"
msgstr "Gebruiker mag nergens heen" msgstr "Gebruiker mag nergens heen"
#: models.py:309 #: models.py:322
msgid "Preferred language" msgid "Preferred language"
msgstr "Voorkeurstaal" msgstr "Voorkeurstaal"
#: models.py:310 #: models.py:323
msgid "Preferred language for e.g. newsletters" msgid "Preferred language for e.g. newsletters"
msgstr "Voorkeurstaal voor b.v.b. nieuwsbrieven" msgstr "Voorkeurstaal voor b.v.b. nieuwsbrieven"
#: models.py:317 #: models.py:330
msgid "Receive opt-in mailings" msgid "Receive opt-in mailings"
msgstr "Ontvang opt-in mailings" msgstr "Ontvang opt-in mailings"
#: models.py:318 #: models.py:331
msgid "Receive mailings about vacancies and events from Thalia's sponsors." msgid "Receive mailings about vacancies and events from Thalia's sponsors."
msgstr "Ontvang mailings over vacatures en evenementen van Thalia's sponsoren." msgstr "Ontvang mailings over vacatures en evenementen van Thalia's sponsoren."
#: models.py:324 #: models.py:337
msgid "Receive newsletter" msgid "Receive newsletter"
msgstr "Ontvang nieuwsbrief" msgstr "Ontvang nieuwsbrief"
#: models.py:325 #: models.py:338
msgid "Receive the Thalia Newsletter" msgid "Receive the Thalia Newsletter"
msgstr "Ontvang de Thalia nieuwsbrief" msgstr "Ontvang de Thalia nieuwsbrief"
#: models.py:332 #: models.py:345
msgid "" msgid ""
"Yes, I want Thalia to take the membership fees from my bank account through " "Yes, I want Thalia to take the membership fees from my bank account through "
"direct debit for each year." "direct debit for each year."
...@@ -302,69 +306,69 @@ msgstr "" ...@@ -302,69 +306,69 @@ msgstr ""
"Ja, ik wil dat Thalia verschuldigde lidmaatschapsgelden elk jaar van mijn " "Ja, ik wil dat Thalia verschuldigde lidmaatschapsgelden elk jaar van mijn "
"bankrekening afschrijft." "bankrekening afschrijft."
#: models.py:335 #: models.py:348
msgid "No, I will pay the contribution myself" msgid "No, I will pay the contribution myself"
msgstr "Nee, ik zal de contributie zelf betalen" msgstr "Nee, ik zal de contributie zelf betalen"
#: models.py:336 #: models.py:349
msgid "Direct debit" msgid "Direct debit"
msgstr "Automatische afschijving" msgstr "Automatische afschijving"
#: models.py:337 #: models.py:350
msgid "Each year, have Thalia take the membership fees from my bank account" msgid "Each year, have Thalia take the membership fees from my bank account"
msgstr "" msgstr ""
"Laat Thalia elk jaar het lidmaatschapsgeld van mijn bankrekening afschrijven" "Laat Thalia elk jaar het lidmaatschapsgeld van mijn bankrekening afschrijven"
#: models.py:343 #: models.py:356
msgid "Bank account" msgid "Bank account"
msgstr "Bankrekening" msgstr "Bankrekening"
#: models.py:344 #: models.py:357
msgid "Bank account for direct debit" msgid "Bank account for direct debit"
msgstr "Bankrekening voor automatische afschrijving" msgstr "Bankrekening voor automatische afschrijving"
#: models.py:371 #: models.py:381
msgid "Display name" msgid "Display name"
msgstr "Weergavenaam" msgstr "Weergavenaam"
#: models.py:396 #: models.py:410
msgid "You need to enter a nickname to use it as display name" msgid "You need to enter a nickname to use it as display name"
msgstr "" msgstr ""
"Je moet een bijnaam invoeren voordat je deze kunt gebruiken als weergavenaam" "Je moet een bijnaam invoeren voordat je deze kunt gebruiken als weergavenaam"
#: models.py:407 #: models.py:444
msgid "Member" msgid "Member"
msgstr "Lid" msgstr "Lid"
#: models.py:408 #: models.py:445
msgid "Supporter" msgid "Supporter"
msgstr "Begunstiger" msgstr "Begunstiger"
#: models.py:409 #: models.py:446
msgid "Honorary Member" msgid "Honorary Member"
msgstr "Erelid" msgstr "Erelid"
#: models.py:414 templates/members/profile.html:37 #: models.py:451 templates/members/profile.html:37
msgid "Membership type" msgid "Membership type"
msgstr "Lidtype" msgstr "Lidtype"
#: models.py:423 #: models.py:459
msgid "User" msgid "User"
msgstr "Gebruiker" msgstr "Gebruiker"
#: models.py:427 #: models.py:463
msgid "Membership since" msgid "Membership since"
msgstr "Lid sinds" msgstr "Lid s