diff --git a/location_app/app/functions/auth/change_password.py b/location_app/app/functions/auth/change_password.py index 7c62b87..5b7dd73 100644 --- a/location_app/app/functions/auth/change_password.py +++ b/location_app/app/functions/auth/change_password.py @@ -22,7 +22,7 @@ def check_pass_data(data): if not (data['password'] == data['r_password']): return "pass_no_match" return "success" - return "no_user" + return "no_id" else: return _status @@ -31,13 +31,15 @@ def check_empty(data): if data['username'] == "": return "empty_id" elif data['day'] == "0": - return "empty_day" + return "empty_bday" elif data['month'] == "0": - return "empty_month" + return "empty_bday" elif data['year'] == "0": - return "empty_year" + return "empty_bday" elif data['password'] == "": return "empty_pass" + elif data['password'] == "": + return "empty_rpass" else: return "ok" diff --git a/location_app/app/functions/auth/create_profile.py b/location_app/app/functions/auth/create_profile.py index 15b95c9..904518d 100644 --- a/location_app/app/functions/auth/create_profile.py +++ b/location_app/app/functions/auth/create_profile.py @@ -13,6 +13,7 @@ def create_profile(data): return _status def check_prof_data(data): + print(data) _status = check_empty(data) if _status == "ok": if base.tid_exists(data['username']): @@ -20,7 +21,7 @@ def check_prof_data(data): if not (data['password'] == data['r_password']): return "pass_no_match" elif not base.check_date(data['day'], data['month'], data['year']): - return "bad_date" + return "wrong_date" else: return "success" else: @@ -35,11 +36,11 @@ def check_empty(data): elif data['realname'] == "": return "empty_name" elif data['day'] == "0": - return "empty_day" + return "empty_bday" elif data['month'] == "0": - return "empty_month" + return "empty_bday" elif data['year'] == "0": - return "empty_year" + return "empty_bday" elif data['gender'] == "": return "empty_gender" elif data['height'] == "": @@ -48,6 +49,8 @@ def check_empty(data): return "empty_weight" elif data['password'] == "": return "empty_pass" + elif data['password'] == "": + return "empty_rpass" else: return "ok" @@ -60,18 +63,4 @@ def make_user(data): cur.execute(com) con.commit() cur.close() - con.close() - - -# ImmutableMultiDict([ -# ('username', '69'), -# ('realname', 'Adi'), -# ('day', '23'), -# ('month', '1'), -# ('year', '1998'), -# ('gender', 'male'), -# ('height', '183'), -# ('weight', '75'), -# ('password', 'fisgib-duwxut-4Rowhi'), -# ('r_password', 'fisgib-duwxut-4Rowhi')]) - + con.close() \ No newline at end of file diff --git a/location_app/app/functions/auth/login.py b/location_app/app/functions/auth/login.py index ec5c6f5..708dbce 100644 --- a/location_app/app/functions/auth/login.py +++ b/location_app/app/functions/auth/login.py @@ -16,9 +16,9 @@ def check_login_data(data): if data['username'] == "admin": return "success" if not base.user_exists(data['username']): - return "no_user" + return "no_id" if not base.compare(data['username'], data['password'], "password"): - return "wrong_password" + return "wrong_pass" return "success" else: return _status diff --git a/location_app/app/static/css/login/create.css b/location_app/app/static/css/login/create.css index 710a70f..817590a 100644 --- a/location_app/app/static/css/login/create.css +++ b/location_app/app/static/css/login/create.css @@ -53,7 +53,7 @@ justify-content: start; align-content: center; grid-template-columns: 2fr 2fr; - grid-template-rows: 0.25fr 1.5fr 0.25fr 1.5fr 0.25fr 1.5fr 0.25fr 1.5fr 1.5fr 0.25fr 1.5fr 1.5fr 1.5fr; + grid-template-rows: 0.25fr 1.5fr 0.15fr 1.5fr 0.15fr 1.5fr 0.15fr 1.5fr 1.5fr 0.15fr 1.5fr 0.15fr 1.5fr 1.5fr 1.5fr; grid-template-areas: '. .' 'user user' @@ -63,7 +63,9 @@ 'dob dob' '. .' 'gender gender' - 'height weight' + 'height height' + '. .' + 'weight weight' '. .' 'pass pass' 'r_pass r_pass' @@ -177,11 +179,12 @@ font-size: 1.5vw; border-radius: 10em; } +.error_text { + color: red; + font-size: 1.5vw; + padding-top: 5px; +} input { width: 100%; font-size: 2vw; -} -input.short { - width: 80%; - font-size: 2vw; } \ No newline at end of file diff --git a/location_app/app/static/css/login/forgot.css b/location_app/app/static/css/login/forgot.css index dcaa9f3..64c4dbd 100644 --- a/location_app/app/static/css/login/forgot.css +++ b/location_app/app/static/css/login/forgot.css @@ -109,6 +109,11 @@ font-size: 2vw; border-radius: 10em; } +.error_text { + color: red; + font-size: 1.5vw; + padding-top: 5px; +} input { width: 100%; font-size: 2vw; diff --git a/location_app/app/templates/login/create.html b/location_app/app/templates/login/create.html index 8370111..78762e2 100644 --- a/location_app/app/templates/login/create.html +++ b/location_app/app/templates/login/create.html @@ -20,7 +20,7 @@
Trackmaster
Create Account - {{status}}
+Create Account