def add_member(handler): data = { k: handler.get_argument(k) for k in filter(lambda key: not key.startswith('_'), handler.request.arguments) } members.add_member(data)
def handle_new_member(message): try: if not mem.is_chat_registered(message): mem.add_chat(message) if mem.allow_add_member(message): mem.add_member(message) rw.save_stats_in_file(mem.file_of_members, mem.members) rw.delete_first__line_in_file(mem.file_of_members) mem.send_greetings(message) except Exception as e: bot.send_message(message.chat.id, e)
def register(): memberID = request.form.get('username') name = request.form.get('name') password = request.form.get('password') email = request.form.get('email') location = request.form.get('location') return jsonify( members.add_member(memberID, name, password, email, location))
def post(self): name = self.request.get('name') email = self.request.get('email') status = self.request.get('status') stuy_id = self.request.get('id') osis = self.request.get('osis') phone = self.request.get('phone') homeroom = self.request.get('homeroom') grade = self.request.get('grade') success = add_member(name, stuy_id, email, status, osis, phone, homeroom, grade) #while not success: # success = add_member(name, stuy_id, email,status,osis,phone,homeroom,grade) send_email(name, stuy_id, email, status, osis, phone, homeroom, grade) template_values = {'email': email} self.render_template('submit.html', template_values)
def login(): memberID = request.form['username'] password = request.form['password'] return jsonify( members.check_member(memberID, password) ) @app.route('/register', methods=['POST']) def register(): memberID = request.form.get('username') name = request.form.get('name') password = request.form.get('password') email = request.form.get('email') location = request.form.get('location') return jsonify( members.add_member(memberID, name, password) ) @app.route('/ban_member', methods=['POST']) def ban_member(): memberID = request.form['username'] return jsonify( members.ban_member(memberID) ) @app.route('/unban_member', methods=['POST']) def unban_member(): memberID = request.form['username'] return jsonify( members.unban_member(memberID) )