From cdb0349e7428769d0fbda40b930388b15cd11a64 Mon Sep 17 00:00:00 2001 From: Aaron Static Date: Thu, 1 Jul 2010 19:54:55 +1000 Subject: [PATCH] sets a default duration of 1 hour for ops, in case people (Matalok) forgets to set one :) --- api/handlers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/handlers.py b/api/handlers.py index 18728d9..d10f74f 100755 --- a/api/handlers.py +++ b/api/handlers.py @@ -143,6 +143,9 @@ class OpTimerHandler(BaseHandler): now = datetime.utcnow() startsIn = int(dt.strftime('%s')) - int(now.strftime('%s')) 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) if startsIn < 0: startsIn = 0