Skip to content

Commit

Permalink
Fix ModelForm.show_create_form with django-money addition
Browse files Browse the repository at this point in the history
  • Loading branch information
cachitas committed Mar 21, 2019
1 parent ef47636 commit 173a67e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyforms_web/widgets/django/modelform.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ def show_create_form(self):
elif callable(field.default):
pyforms_field.value = field.default()

elif isinstance(field, models.DecimalField) and type(field).__name__ == 'MoneyField':
pyforms_field.value = field.default.amount
else:
pyforms_field.value = field.default

Expand Down

0 comments on commit 173a67e

Please sign in to comment.