def signup_page(): if request.method == 'GET': all_cities = CityDatabaseOPS.select_all_cities() return render_template('signup_page.html', signedin=False, cities=all_cities) else: if 'signup' in request.form: user = UserDatabaseOPS.select_user(request.form['knittername']) samename = False if user and user != -1: if user.username == request.form['knittername']: return render_template('signup_page.html', samename=True) else: UserDatabaseOPS.add_user(request.form['knittername'], request.form['inputPassword'], request.form['profile_pic'], request.form['cover_pic'], request.form['inputEmail']) selected_city_id = request.form['city_id'] UserDatabaseOPS.add_user_detail(request.form['knittername'], request.form['real_name'], request.form['real_surname'], selected_city_id) return render_template('login_page.html', newly_signup=True, signedin=False, samename=samename)
def database_initialization(): database.create_tables() UserDatabaseOPS.add_user( "mesut_guneri", "tokmak", "tokmak", "tokmak", "cobanyildizi") # Can Altinigne Insert Into User Table Manually KnotDatabaseOPS.add_knot(1, "First content of the Knitter", 0, 0, "2016-10-29") InteractionDatabaseOPS.add_user_interaction( 1, 10) # ilknur meray: insert into USER_INTERACTION table manually MessageDatabaseOPS.add_message( 'Thanks for database management systems lecture notes!', 1, 2) NotificationDatabaseOPS.insert_relation(1, 1, True) return redirect(url_for('site.login_page'))
def signup_page(): if request.method == 'GET': return render_template('signup_page.html', signedin=False) else: if 'signup' in request.form: user = UserDatabaseOPS.select_user(request.form['knittername']) if user and user != -1: if user.username == request.form['knittername']: return render_template('signup_page.html', samename=True) else: UserDatabaseOPS.add_user(request.form['knittername'], request.form['inputPassword'], request.form['profile_pic'], request.form['cover_pic'], request.form['inputEmail']) return render_template('login_page.html', newly_signup=True, signedin=False)