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", }