def get(self): """ handle the get request for the user_card api """ try: data = get_user_card() except Exception as e: data = {'error': str(e)} self.write_json(data)
def get(self): """ handle the get request for the user_card api """ try: data = get_user_card() except Exception as e: data = {'error' : str(e)} self.write_json(data)
def get(self): """ return the user card if possible, else return an error """ if not users.get_current_user(): return {'error': 'you must be logged in to view this info'}, 401 else: try: data = get_user_card() except Exception as e: data = {'error' : str(e)} return data
def get(self): """ return the user card if possible, else return an error """ if not users.get_current_user(): return {'error': 'you must be logged in to view this info'}, 401 else: try: data = get_user_card() except Exception as e: data = {'error': str(e)} return data