Simplify from claude
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user