def signup(): form = SignUpForm() if form.validate_on_submit(): username = request.form['username'] password = functions.generate_password_hash(request.form['password']) email = request.form['email'] check = functions.check_username(username) if check: flash('Username already taken!') else: functions.signup_user(username, password, email) session['username'] = username user_id = functions.check_user_exists(username, password) session['id'] = user_id return redirect('/profile/') return render_template('signup.html', form=form)
def signup(): ''' App za registraciju novog korisnika ''' form = SignUpForm() if form.validate_on_submit(): username = request.form['username'] password = functions.generate_password_hash(request.form['password']) email = request.form['email'] check = functions.check_username(username) if check: flash('Korisničko ime se već koristi!') else: functions.signup_user(username, password, email) session['username'] = username user_id = functions.check_user_exists(username, password) session['id'] = user_id return redirect('/profile/') return render_template('signup.html', form=form)
def signup(): ''' App for registering new user ''' form = SignUpForm() if form.validate_on_submit(): username = request.form['username'] password = functions.generate_password_hash(request.form['password']) email = request.form['email'] phone_number = request.form['phone_number'] street = request.form['street'] city = request.form['city'] state = request.form['state'].upper() check = functions.check_username(username) if check: flash('Username already taken!') else: functions.signup_user(username, password, email, phone_number, street, city, state) session['username'] = username user_id = functions.check_user_exists(username, password) session['id'] = user_id return redirect('/homepage') return render_template('signup.html', form=form)