mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-28 17:32:38 +02:00
project: set XXX as default default_currency for API backwards compatibility
The new support for currency broke backwards compatibility on the API: $ curl -X POST $URL/api/projects -d 'name=yay&id=yay&password=yay&contact_email=yay@notmyidea.org' {"default_currency": ["This field is required."]} This is a case we were not testing (will be fixed in subsequent commits) To fix this, simply set default_currency to XXX by default.
This commit is contained in:
parent
7d9226745f
commit
421cfbe645
1 changed files with 5 additions and 1 deletions
|
@ -113,7 +113,11 @@ class EditProjectForm(FlaskForm):
|
|||
project_history = BooleanField(_("Enable project history"))
|
||||
ip_recording = BooleanField(_("Use IP tracking for project history"))
|
||||
currency_helper = CurrencyConverter()
|
||||
default_currency = SelectField(_("Default Currency"), validators=[DataRequired()])
|
||||
default_currency = SelectField(
|
||||
_("Default Currency"),
|
||||
validators=[DataRequired()],
|
||||
default=CurrencyConverter.no_currency,
|
||||
)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
if not hasattr(self, "id"):
|
||||
|
|
Loading…
Reference in a new issue