From 7ce619911f9ddcdedb188ccab42210d3441d6f78 Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Sat, 7 Jan 2017 19:03:00 -0600 Subject: [PATCH] Update constraints. --- bikeshop_project/bike/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bikeshop_project/bike/models.py b/bikeshop_project/bike/models.py index 416fd62..98199fc 100644 --- a/bikeshop_project/bike/models.py +++ b/bikeshop_project/bike/models.py @@ -78,7 +78,8 @@ class Bike(models.Model): return self.stolen is False and self.cpic_searched_at is not None and self.serial_number is not None def can_claim(self): - return self.claimed_by is None or self.last_worked_on > timezone.now() + timedelta(weeks=4) + return self.claimed_by is None or not (self.claimed_by is not None and self.last_worked_on > timezone.now() + timedelta( + weeks=4)) or self.last_worked_on is None def can_purchase(self): if self.claimed_by: