def __listEmailAuth(self, req): uid = self.__uid(req) if uid == None: print "a" return ["[]"] try: uid = int(uid) except: print "b" logging.error("__listEmailAuth failure", exc_info=1) return ["[]"] emails = [] session = Session[0]() print "UID is", uid for e in session.query(MethodEmail[0]).filter_by(uid=uid).all(): emails.append(e.email) return [tojson(emails)]
def format_query(**data): data['notify_format'] = 'json' return {'json': tojson({'query': bool_to_yesno(data)})}