Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
ddc60dd8
Commit
ddc60dd8
authored
Sep 27, 2017
by
Jim Driessen
Browse files
Prevent setting automatic member payment fees to true without an IBAN.
parent
8a5cc220
Changes
2
Hide whitespace changes
Inline
Side-by-side
website/members/admin.py
View file @
ddc60dd8
...
...
@@ -31,6 +31,7 @@ class ProfileInline(admin.StackedInline):
'emergency_contact_phone_number'
,
'language'
,
'event_permissions'
)
model
=
models
.
Profile
form
=
forms
.
MemberForm
can_delete
=
False
...
...
website/members/forms.py
View file @
ddc60dd8
...
...
@@ -23,6 +23,14 @@ class ProfileForm(forms.ModelForm):
'receive_optin'
,
'receive_newsletter'
]
model
=
Profile
def
clean
(
self
):
direct_debit_authorized
=
self
.
cleaned_data
\
.
get
(
'direct_debit_authorized'
)
bank_account
=
self
.
cleaned_data
.
get
(
'bank_account'
)
if
direct_debit_authorized
and
len
(
bank_account
)
<
16
:
raise
forms
.
ValidationError
(
_
(
'Bank account is incorrect'
))
super
().
clean
()
class
UserCreationForm
(
BaseUserCreationForm
):
# Don't forget to edit the formset in admin.py!
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment