aboutsummaryrefslogtreecommitdiff
path: root/budget
diff options
context:
space:
mode:
authorJocelyn Delalande <jocelyn@crapouillou.net>2017-03-29 15:09:28 +0200
committerJocelyn Delalande <jocelyn@crapouillou.net>2017-03-29 15:11:40 +0200
commitec75e554160232a32df9ed1e6ed286a85c4fcb00 (patch)
tree376adb583d6ad0577f8cd22fb4fdb1c1895d267a /budget
parent2609c4aaa7605addcf322c9deaf6065ae61ac262 (diff)
downloadihatemoney-mirror-ec75e554160232a32df9ed1e6ed286a85c4fcb00.zip
ihatemoney-mirror-ec75e554160232a32df9ed1e6ed286a85c4fcb00.tar.gz
ihatemoney-mirror-ec75e554160232a32df9ed1e6ed286a85c4fcb00.tar.bz2
Remove deprecated wtforms TextField
It is a bare alias of StringField (thus, no alembic migration is required), deprecated since wtforms v2.0 (2013). Removes the following warning: > DeprecationWarning: The TextField alias for StringField has been deprecated and will be removed in WTForms 3.0 Ref https://github.com/wtforms/wtforms/commit/f07729dd45c0f5191f131d37adb0456104dc7c44
Diffstat (limited to 'budget')
-rw-r--r--budget/forms.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/budget/forms.py b/budget/forms.py
index 6967983..f446475 100644
--- a/budget/forms.py
+++ b/budget/forms.py
@@ -1,7 +1,7 @@
from flask_wtf.form import FlaskForm
from wtforms.fields.core import SelectField, SelectMultipleField
from wtforms.fields.html5 import DateField, DecimalField
-from wtforms.fields.simple import PasswordField, SubmitField, TextAreaField, TextField
+from wtforms.fields.simple import PasswordField, SubmitField, TextAreaField, StringField
from wtforms.validators import Email, Required, ValidationError
from flask_babel import lazy_gettext as _
from flask import request
@@ -38,9 +38,9 @@ class CommaDecimalField(DecimalField):
class EditProjectForm(FlaskForm):
- name = TextField(_("Project name"), validators=[Required()])
- password = TextField(_("Private code"), validators=[Required()])
- contact_email = TextField(_("Email"), validators=[Required(), Email()])
+ name = StringField(_("Project name"), validators=[Required()])
+ password = StringField(_("Private code"), validators=[Required()])
+ contact_email = StringField(_("Email"), validators=[Required(), Email()])
def save(self):
"""Create a new project with the information given by this form.
@@ -62,7 +62,7 @@ class EditProjectForm(FlaskForm):
class ProjectForm(EditProjectForm):
- id = TextField(_("Project identifier"), validators=[Required()])
+ id = StringField(_("Project identifier"), validators=[Required()])
password = PasswordField(_("Private code"), validators=[Required()])
submit = SubmitField(_("Create the project"))
@@ -78,13 +78,13 @@ class ProjectForm(EditProjectForm):
class AuthenticationForm(FlaskForm):
- id = TextField(_("Project identifier"), validators=[Required()])
+ id = StringField(_("Project identifier"), validators=[Required()])
password = PasswordField(_("Private code"), validators=[Required()])
submit = SubmitField(_("Get in"))
class PasswordReminder(FlaskForm):
- id = TextField(_("Project identifier"), validators=[Required()])
+ id = StringField(_("Project identifier"), validators=[Required()])
submit = SubmitField(_("Send me the code by email"))
def validate_id(form, field):
@@ -94,7 +94,7 @@ class PasswordReminder(FlaskForm):
class BillForm(FlaskForm):
date = DateField(_("Date"), validators=[Required()], default=datetime.now)
- what = TextField(_("What?"), validators=[Required()])
+ what = StringField(_("What?"), validators=[Required()])
payer = SelectField(_("Payer"), validators=[Required()], coerce=int)
amount = CommaDecimalField(_("Amount paid"), validators=[Required()])
payed_for = SelectMultipleField(_("For whom?"),
@@ -129,7 +129,7 @@ class BillForm(FlaskForm):
class MemberForm(FlaskForm):
- name = TextField(_("Name"), validators=[Required()])
+ name = StringField(_("Name"), validators=[Required()])
weight = CommaDecimalField(_("Weight"), default=1)
submit = SubmitField(_("Add"))