From cdbfabf0ea855df854b2357dc124df03f18d0514 Mon Sep 17 00:00:00 2001 From: Tom Flux Date: Mon, 22 Jun 2026 22:50:48 +0100 Subject: Simplify from claude --- kitchen/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kitchen/models.py') 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 -- cgit v1.2.3