Simplify from claude

This commit is contained in:
Tom Flux
2026-06-22 22:50:48 +01:00
parent e65dd6f29c
commit 173e74b4a9
5 changed files with 96 additions and 101 deletions
+2 -2
View File
@@ -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