1
0
mirror of https://github.com/fspc/workstand.git synced 2025-02-23 09:13:23 -05:00

Update constraints.

This commit is contained in:
Drew Larson 2017-01-07 19:03:00 -06:00
parent 957f52086b
commit 7ce619911f

View File

@ -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: