Use NULL for non-existant passwords
This commit is contained in:
@@ -73,7 +73,7 @@ def callback(oauth_token):
|
||||
flash("Unable to find an account for that Github user", "danger")
|
||||
return redirect(url_for("users.claim"))
|
||||
elif loginUser(userByGithub):
|
||||
if not current_user.hasPassword():
|
||||
if not current_user.password:
|
||||
return redirect(next_url or url_for("users.set_password", optional=True))
|
||||
else:
|
||||
return redirect(next_url or url_for("homepage.home"))
|
||||
|
||||
@@ -143,7 +143,7 @@ def change_password():
|
||||
@bp.route("/user/set-password/", methods=["GET", "POST"])
|
||||
@login_required
|
||||
def set_password():
|
||||
if current_user.hasPassword():
|
||||
if current_user.password:
|
||||
return redirect(url_for("users.change_password"))
|
||||
|
||||
form = SetPasswordForm(request.form)
|
||||
|
||||
Reference in New Issue
Block a user