diff --git a/__init__.py b/__init__.py index 70a5a77..2b53970 100644 --- a/__init__.py +++ b/__init__.py @@ -22,8 +22,6 @@ def register(): userLogin = request.form['UserLogin'] userPassw = request.form['UserPassw'] db_routing.add_user(userLogin, passw_hash(userPassw)) - else: - print('Логин занят') return render_template('registration.html') diff --git a/db_routing.py b/db_routing.py index 3465184..0a6a560 100644 --- a/db_routing.py +++ b/db_routing.py @@ -19,6 +19,8 @@ def add_user(user_name, passw_hash): new_user = User(UserName=user_name, UserPassw=passw_hash) db.session.add(new_user) db.session.commit() + else: + print('Логин занят') def find_user(user_name):