mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 15:51:19 +00:00
Add inactive state for counters
This commit is contained in:
parent
be7e0401dd
commit
0d6b93d085
@ -223,10 +223,10 @@ class Counter(models.Model):
|
||||
|
||||
def is_inactive(self):
|
||||
"""
|
||||
Returns True if the counter self is inactive from 10 minutes, else False
|
||||
Returns True if the counter self is inactive from 5 minutes, else False
|
||||
"""
|
||||
if (self.is_open()):
|
||||
return ((timezone.now() - self.permanencies.model.objects.order_by('-activity').first().activity) > datetime.timedelta(minutes=10))
|
||||
return ((timezone.now() - self.permanencies.model.objects.order_by('-activity').first().activity) > datetime.timedelta(minutes=5))
|
||||
else:
|
||||
return False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user