コード例 #1
0
ファイル: oauth.py プロジェクト: skarzi/mapa_huncwotow
 def get(self):
     app_hash = request.args['hash']
     user = Users.get_or_create(app_hash=app_hash)
     if user.is_authorized():
         return {"success": True}
     else:
         return {"success": False, "url": self.get_oauth_url(app_hash)}
コード例 #2
0
 def get(self):
     app_hash = request.args['hash']
     user = Users.get_or_create(app_hash=app_hash)
     response = user.get_classes()
     if response:
         first_classes = response[0]
         date, time = first_classes["start_time"].split()
         time = time[:-3]
         return {
             "name": first_classes["name"]["pl"],
             "room": first_classes["room_number"],
             "time": time
         }
     else:
         return {}, 404