# HG changeset patch # User Dennis Fink # Date 2015-07-21 18:15:21 # Node ID 05866e023ce5ea5781059f44acb9225e9cd45d1a # Parent 6a3b432f7efbdc393c8f1fce3bb3f055fbd78f61 Fixed dynamic address form diff --git a/ennstatus/donate/views.py b/ennstatus/donate/views.py --- a/ennstatus/donate/views.py +++ b/ennstatus/donate/views.py @@ -29,9 +29,8 @@ def snailmail(): if request.method == 'POST': current_app.logger.debug('Validating form') - if form.validate_on_submit(): - country = form.country.data - return redirect(url_for('donate.snailmail', country=country)) + country = form.country.data + return redirect(url_for('donate.snailmail', country=country)) else: if 'country' in request.args: country = request.args['country'] diff --git a/ennstatus/root/forms.py b/ennstatus/root/forms.py --- a/ennstatus/root/forms.py +++ b/ennstatus/root/forms.py @@ -3,7 +3,6 @@ from wtforms import SelectField, StringF from wtforms.validators import InputRequired, Email, Length, DataRequired - COUNTRIES = [ ('luxembourg', 'Luxembourg'), ('united_kingdom', 'United Kingdom'), @@ -16,7 +15,6 @@ COUNTRIES = [ class BPMForm(Form): country = SelectField('Country', - validators=[DataRequired()], choices=COUNTRIES) diff --git a/ennstatus/root/views.py b/ennstatus/root/views.py --- a/ennstatus/root/views.py +++ b/ennstatus/root/views.py @@ -62,9 +62,8 @@ def contact(): if request.method == 'POST': current_app.logger.debug('Validating form') - if form.validate_on_submit(): - country = form.country.data - return redirect(url_for('root.contact', country=country)) + country = form.country.data + return redirect(url_for('root.contact', country=country)) else: if 'country' in request.args: country = request.args['country']