Skip to content

Syncing with source #1

Merged
merged 4 commits into from Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
@@ -1 +1,2 @@
*~
*~
app/__pycache__
12 changes: 5 additions & 7 deletions app/app.py
Expand Up @@ -48,19 +48,15 @@ def index():
return flask.render_template("index.html",
bookList = bookQry)


@app.route("/about")
def about():
return flask.render_template("about.html")



@app.route("/login", methods=["GET", "POST"])
def login():

prev = flask.request.args.get("prev")
if not prev:
prev == "index"
prev = "index"

if flask.request.method == "POST":
#Get data
Expand Down Expand Up @@ -224,10 +220,12 @@ def updateUser(userId):
if flask.request.method == "POST":
logging.warning("------------------------")
current = flask.request.form.get("current")
hashedCurrent = hashlib.sha512(current.encode()).hexdigest()
password = flask.request.form.get("password")
hashedPw = hashlib.sha512(password.encode()).hexdigest()
if current:
if current == thisUser.password:
thisUser.password = password
if hashedCurrent == thisUser.password:
thisUser.password = hashedPw
db.session.commit()
else:
flask.flash("Current Password is incorrect")
Expand Down