mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-30 22:29:32 +00:00
counter inactive state with settings variable, traduction file problem fixed
This commit is contained in:
1 parent
7f6424d51e
commit
57b663c4c5
5 files changed
+237
-110
No files matched your search
+2
-5
@@ -223,12 +223,9 @@ 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 SITH_COUNTER_MINUTE_INACTIVE's value minutes, else False
|
||||
"""
|
||||
if (self.is_open()):
|
||||
return ((timezone.now() - self.permanencies.model.objects.order_by('-activity').first().activity) > datetime.timedelta(minutes=10))
|
||||
else:
|
||||
return False
|
||||
return self.is_open() and ((timezone.now() - self.permanencies.order_by('-activity').first().activity) > datetime.timedelta(minutes=settings.SITH_COUNTER_MINUTE_INACTIVE))
|
||||
|
||||
def barman_list(self):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user