From 6c986e857290cba61c8c5e27e7af6e316af7414e Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Wed, 10 Aug 2011 15:58:13 +0100 Subject: [PATCH] Make the json consistant, ints for ints, strings for strings --- app/api/handlers/oauth.py | 8 ++++---- app/api/handlers/v1.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/api/handlers/oauth.py b/app/api/handlers/oauth.py index 742bfbb..8c4401a 100644 --- a/app/api/handlers/oauth.py +++ b/app/api/handlers/oauth.py @@ -76,12 +76,12 @@ class OAuthOpTimerHandler(BaseHandler): if endsIn > 0: event = { 'startsIn': startsIn, - 'eventID': node.getAttribute('eventID'), + 'eventID': int(node.getAttribute('eventID')), 'ownerName': node.getAttribute('ownerName'), 'eventDate': date, 'eventTitle': node.getAttribute('eventTitle'), 'duration': duration, - 'isImportant': node.getAttribute('importance'), + 'isImportant': int(node.getAttribute('importance')), 'eventText': node.getAttribute('eventText'), 'endsIn':endsIn, 'forumLink': forumlink} @@ -90,12 +90,12 @@ class OAuthOpTimerHandler(BaseHandler): if len(events) == 0: return {'ops':[{ 'startsIn': -1, - 'eventID': '0', + 'eventID': 0, 'ownerName': '', 'eventDate': '', 'eventTitle': '
No ops are currently scheduled
', 'duration': 0, - 'isImportant': '0', + 'isImportant': 0, 'eventText': 'Add ops using EVE-Gate or the in-game calendar', 'endsIn':-1, 'forumLink': ''}]} diff --git a/app/api/handlers/v1.py b/app/api/handlers/v1.py index cdb980d..6369ec2 100644 --- a/app/api/handlers/v1.py +++ b/app/api/handlers/v1.py @@ -170,12 +170,12 @@ class OpTimerHandler(BaseHandler): if endsIn > 0: event = { 'startsIn': startsIn, - 'eventID': node.getAttribute('eventID'), + 'eventID': int(node.getAttribute('eventID')), 'ownerName': node.getAttribute('ownerName'), 'eventDate': date, 'eventTitle': node.getAttribute('eventTitle'), 'duration': duration, - 'isImportant': node.getAttribute('importance'), + 'isImportant': int(node.getAttribute('importance')), 'eventText': node.getAttribute('eventText'), 'endsIn':endsIn, 'forumLink': forumlink}