mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-19 12:49:22 +00:00
Checks if we have a forum link before giving the URL
This commit is contained in:
@@ -154,6 +154,12 @@ 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'))
|
||||||
|
|
||||||
|
fid = re.search('topic=[\d]+', node.getAttribute('eventText'))
|
||||||
|
if fid:
|
||||||
|
forumlink = 'http://forum.pleaseignore.com/index.php?%s' % id
|
||||||
|
else:
|
||||||
|
forumlink = ''
|
||||||
#In case people forget to set a duration, we'll give a default of 1 hour
|
#In case people forget to set a duration, we'll give a default of 1 hour
|
||||||
if duration == 0:
|
if duration == 0:
|
||||||
duration = 60
|
duration = 60
|
||||||
@@ -171,7 +177,7 @@ class OpTimerHandler(BaseHandler):
|
|||||||
'isImportant': node.getAttribute('importance'),
|
'isImportant': node.getAttribute('importance'),
|
||||||
'eventText': node.getAttribute('eventText'),
|
'eventText': node.getAttribute('eventText'),
|
||||||
'endsIn':endsIn,
|
'endsIn':endsIn,
|
||||||
'forumLink': 'http://forum.pleaseignore.com/index.php?%s' % re.search('topic=[\d]+', node.getAttribute('eventText'))
|
'forumLink': forumlink
|
||||||
}
|
}
|
||||||
events.append(event)
|
events.append(event)
|
||||||
if len(events) == 0:
|
if len(events) == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user