Skip to content

Commit

Permalink
Make sure we handle null values in fractions
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanNoelk committed Apr 15, 2018
1 parent 7c626e3 commit 7ded9e2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions v1/ingredient/migrations/0011_auto_20180415_2352.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.0.1 on 2018-04-15 23:52

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('ingredient', '0010_auto_20180330_1058'),
]

operations = [
migrations.AlterField(
model_name='ingredient',
name='numerator',
field=models.FloatField(default=0, verbose_name='numerator'),
),
]
2 changes: 1 addition & 1 deletion v1/ingredient/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Ingredient(models.Model):
# It should be removed in future versions.
title = models.CharField(_('title'), max_length=250)
quantity = models.FloatField(_('quantity'), default=0)
numerator = models.FloatField(_('numerator'), default=1)
numerator = models.FloatField(_('numerator'), default=0)
denominator = models.FloatField(_('denominator'), default=1)
measurement = models.CharField(_('measurement'), max_length=200, blank=True, null=True)
ingredient_group = models.ForeignKey(IngredientGroup, on_delete=models.CASCADE, related_name='ingredients', null=True)
Expand Down

0 comments on commit 7ded9e2

Please sign in to comment.