def register_user(): firstname = request.form['firstname'] lastname = request.form['lastname'] username = request.form['username'] password = request.form['password'] register_dao_obj = RegisterDAO() register_dao_obj.insert_data(firstname, lastname, username, password) return redirect('/')
def inner(*args, **kwargs): username = kwargs['username'] user = User.get(User.username == username) b = BlockList.select().where(BlockList.blocker == current_user.id) v = BlockList.select().where( BlockList.blocked_person == current_user.id) blist = [i.blocked_person.id for i in b] for p in v: blist.append(p.blocker.id) if user.id in blist: return redirect(url_for('main.index')) return f(*args, **kwargs)
def update_user(id): if request.method == 'GET': register_dao_obj = RegisterDAO() return_data = register_dao_obj.search_data(id) return render_template('update.html', result=return_data) else: firstname = request.form['firstname'] lastname = request.form['lastname'] username = request.form['username'] password = request.form['password'] register_dao_obj = RegisterDAO() register_dao_obj.update_data(firstname, lastname, username, password, id) return redirect('/search')
def inner(*args, **kwargs): if not current_user: return redirect(url_for('index')) return f(*args, **kwargs)
def inner(*args, **kwargs): if current_user.profile: return redirect(url_for('profile.edit_profile')) return f(*args, **kwargs)