Return error if confirm_password is filled but not new_password

(imported from commit c58ca8d2f5592c4cf062b963f3cca6673242419e)
This commit is contained in:
Tyler Hallada 2012-12-20 22:17:49 -05:00
parent f276ad2dce
commit 3763dca4a6

View File

@ -885,7 +885,7 @@ def json_change_settings(request, user_profile, full_name=POST,
# because browsers POST nothing for an unchecked checkbox
enable_desktop_notifications=POST(converter=lambda x: x == "on",
default=False)):
if new_password != "":
if new_password != "" or confirm_password != "":
if new_password != confirm_password:
return json_error("New password must match confirmation password!")
if not authenticate(username=user_profile.user.email, password=old_password):