From e861322a568d07832d28f96d1c01265433c1cc80 Mon Sep 17 00:00:00 2001 From: Glandos Date: Sat, 13 Nov 2021 21:35:28 +0100 Subject: [PATCH] switch back to empty string as default WTForm backward compatibility needs that --- ihatemoney/forms.py | 2 +- ihatemoney/tests/api_test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ihatemoney/forms.py b/ihatemoney/forms.py index 6800df10..27e438b9 100644 --- a/ihatemoney/forms.py +++ b/ihatemoney/forms.py @@ -325,7 +325,7 @@ class BillForm(FlaskForm): original_currency = SelectField(_("Currency"), validators=[DataRequired()]) external_link = URLField( _("External link"), - default=None, + default="", validators=[Optional(), URL()], description=_("A link to an external document, related to this bill"), ) diff --git a/ihatemoney/tests/api_test.py b/ihatemoney/tests/api_test.py index 9a2d2149..1365fa02 100644 --- a/ihatemoney/tests/api_test.py +++ b/ihatemoney/tests/api_test.py @@ -539,7 +539,7 @@ class APITestCase(IhatemoneyTestCase): "amount": expected_amount, "date": "2011-08-10", "id": id, - "external_link": None, + "external_link": "", "original_currency": "XXX", "converted_amount": expected_amount, } @@ -834,7 +834,7 @@ class APITestCase(IhatemoneyTestCase): "amount": 25.0, "date": "2011-08-10", "id": 1, - "external_link": None, + "external_link": "", "converted_amount": 25.0, "original_currency": "XXX", }