mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-17 11:49:29 +00:00
sets a default duration of 1 hour for ops, in case people (Matalok)
forgets to set one :)
This commit is contained in:
@@ -143,6 +143,9 @@ class OpTimerHandler(BaseHandler):
|
|||||||
now = datetime.utcnow()
|
now = datetime.utcnow()
|
||||||
startsIn = int(dt.strftime('%s')) - int(now.strftime('%s'))
|
startsIn = int(dt.strftime('%s')) - int(now.strftime('%s'))
|
||||||
duration = int(node.getAttribute('duration'))
|
duration = int(node.getAttribute('duration'))
|
||||||
|
#In case people forget to set a duration, we'll give a default of 1 hour
|
||||||
|
if duration == 0:
|
||||||
|
duration = 3600
|
||||||
endsIn = startsIn + (duration * 60)
|
endsIn = startsIn + (duration * 60)
|
||||||
if startsIn < 0:
|
if startsIn < 0:
|
||||||
startsIn = 0
|
startsIn = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user