From c9a3ffb294b5b55968cf6a8a9d5d89dedfb648e8 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Mon, 28 Aug 2017 17:07:58 +0200 Subject: [PATCH] Don't crash when unauthenticated users try to change password --- pgweb/account/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgweb/account/views.py b/pgweb/account/views.py index d9b9152e..d282e9ff 100644 --- a/pgweb/account/views.py +++ b/pgweb/account/views.py @@ -226,7 +226,7 @@ def logout(request): return authviews.logout_then_login(request, login_url='/') def changepwd(request): - if request.user.password == OAUTH_PASSWORD_STORE: + if hasattr(request.user, 'password') and request.user.password == OAUTH_PASSWORD_STORE: return HttpServerError("This account cannot change password as it's connected to a third party login site.") log.info("Initiating password change from {0}".format(get_client_ip(request))) -- 2.39.5