Skip to content
Permalink
Browse files

Fix estimated balance empty if zero

  • Loading branch information...
ibot3 committed Sep 20, 2019
1 parent 1107a99 commit 473721d47ff2dfe41292920d23733c08cfe08ae2
Showing with 7 additions and 6 deletions.
  1. +2 −2 sipa/blueprints/usersuite.py
  2. +5 −4 sipa/forms.py
@@ -488,8 +488,8 @@ def terminate_membership_confirm():

if end_date is not None:
try:
form.estimated_balance.default = current_user.estimate_balance(
end_date)
form.estimated_balance.default = str(current_user.estimate_balance(
end_date))

except UnknownError:
flash(gettext("Unbekannter Fehler!"), "error")
@@ -8,7 +8,7 @@
from flask_wtf import FlaskForm
from werkzeug.local import LocalProxy
from wtforms import (BooleanField, HiddenField, PasswordField, SelectField,
StringField, TextAreaField, RadioField, IntegerField, DateField, FloatField)
StringField, TextAreaField, RadioField, IntegerField, DateField)
from wtforms.validators import (AnyOf, DataRequired, Email, EqualTo,
MacAddress, Regexp, ValidationError, NumberRange, Optional, Length)

@@ -247,9 +247,10 @@ class TerminateMembershipConfirmForm(FlaskForm):
render_kw={'readonly': True},
validators=[DataRequired("invalid end date")])

estimated_balance = FloatField(label=lazy_gettext("Geschätzter Kontostand (in EUR) zum Ende der Mitgliedschaft"),
render_kw={'readonly': True},
validators=[DataRequired("invalid balance")])
estimated_balance = StringField(
label=lazy_gettext("Geschätzter Kontostand (in EUR) zum Ende der Mitgliedschaft"),
render_kw={'readonly': True},
validators=[DataRequired("invalid balance")])

confirm_termination = BooleanField(default=lazy_gettext(
"Ich bestätige, dass ich meine Mitgliedschaft zum obenstehenden Datum beenden möchte"),

0 comments on commit 473721d

Please sign in to comment.
You can’t perform that action at this time.