diff options
Diffstat (limited to 'kitchen/models.py')
| -rw-r--r-- | kitchen/models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kitchen/models.py b/kitchen/models.py index 9c3e8d3..ab0a720 100644 --- a/kitchen/models.py +++ b/kitchen/models.py @@ -1,3 +1,5 @@ +from datetime import date, timedelta + from django.db import models from django.core.exceptions import ValidationError @@ -72,8 +74,6 @@ class PantryItem(models.Model): if self.location == self.Location.FRIDGE and self.expiry_date is None: # Try to auto-set from ingredient shelf life if self.ingredient_id and self.ingredient.shelf_life_days: - from datetime import date, timedelta - self.expiry_date = date.today() + timedelta(days=self.ingredient.shelf_life_days) # Don't raise an error — some fridge items just don't have a known expiry |
