diff options
| author | Tom Flux <tom@tomflux.xyz> | 2026-06-22 22:50:48 +0100 |
|---|---|---|
| committer | Tom Flux <tom@tomflux.xyz> | 2026-06-22 22:50:48 +0100 |
| commit | cdbfabf0ea855df854b2357dc124df03f18d0514 (patch) | |
| tree | b54a502435ea46745356f352679cf8d5020a2beb /kitchen/models.py | |
| parent | 96d9c4b22e5bcae1d19b2dd1fcae3bc46f080254 (diff) | |
Simplify from claude
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 |
