Permalink
Browse files

Added activeuser JSON

  • Loading branch information...
1 parent 3a4b9ff commit 698be738d3a714df8b09db10cd85af93a698a8b1 @swvist committed Oct 11, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 index.py
View
@@ -46,6 +46,16 @@ def get(self):
int(userdb.userPermutation(int(self.request.get('question')))),
self.request.get('answer')))
+class contestActiveuser(webapp.RequestHandler):
+ def get(self):
+ self.response.headers['Content-Type'] = 'application/json'
+ user = users.get_current_user()
+ if user:
+ self.response.out.write("{ \"name\" : \""+user.nickname()+"\" }")
+ else:
+ self.response.out.write("{ \"name\" : \"NULL\" }")
+
+
class adminQuestionsAdd(webapp.RequestHandler):
def get(self):
if users.get_current_user():
@@ -131,6 +141,7 @@ def get(self):
('/contest/stop/',contestStop),
('/contest/question/(\d*)|/', contestQuestion),
('/contest/answer/', contestAnswer),
+ ('/contest/activeuser/', contestActiveuser),
('/admin/questions/add/', adminQuestionsAdd),
('/admin/questions/submit/', adminQuestionsSubmit),
('/admin/questions/list/',adminQuestionsList),

0 comments on commit 698be73

Please sign in to comment.