Added start_date clause to traveller.is_active() function
This commit is contained in:
@@ -249,6 +249,10 @@ class Traveller(models.Model):
|
||||
def is_active(self):
|
||||
if self.is_archived:
|
||||
return False
|
||||
if not self.travel_start_date:
|
||||
return False
|
||||
if datetime(self.travel_start_date.year, self.travel_start_date.month, self.travel_start_date.day) > datetime.today():
|
||||
return False
|
||||
if not self.travel_end_date:
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user