From 23d43fc3e14d66d386490d30348aea6d27ff41ba Mon Sep 17 00:00:00 2001 From: crunk Date: Sat, 12 Feb 2022 19:25:13 +0100 Subject: [PATCH] user gets feedback on registration and login --- verse/start.py | 9 +++++++-- verse/static/css/style.css | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/verse/start.py b/verse/start.py index 71cd405..5bb529a 100644 --- a/verse/start.py +++ b/verse/start.py @@ -113,21 +113,27 @@ def register(): except InvalidRequestError: db.session.rollback() + registerform.email.errors.append("Something went wrong!") flash("Something went wrong!", "danger") except IntegrityError: db.session.rollback() - flash("User already exists!.", "warning") + registerform.email.errors.append("User already exists!") + flash("User already exists!", "warning") except DataError: db.session.rollback() + registerform.email.errors.append("Invalid Entry") flash("Invalid Entry", "warning") except InterfaceError: db.session.rollback() + registerform.email.errors.append("Error connecting to the database") flash("Error connecting to the database", "danger") except DatabaseError: db.session.rollback() + registerform.email.errors.append("Error connecting to the database") flash("Error connecting to the database", "danger") except BuildError: db.session.rollback() + egisterform.email.errors.append("Unknown error occured!") flash("An error occured !", "danger") return render_template("register.html", registerform=registerform) @@ -151,7 +157,6 @@ def distribusi(): if os.path.exists(unzipfile): os.remove(os.path.join(userfolder, zipfilename)) # To Do: Make sure nothing can be executed from the upload folder - # add the css file cssfile = "" for filename in os.listdir(userfolder): if filename.endswith(".css"): diff --git a/verse/static/css/style.css b/verse/static/css/style.css index 1544175..7ace5b1 100644 --- a/verse/static/css/style.css +++ b/verse/static/css/style.css @@ -92,6 +92,10 @@ input[type="submit"]:disabled:focus { background-color: #2D3039; color: #d28cff; } +.error { + color: #ff5a5a; +} + /* unvisited link */ a:link {