From 7b365a28c77fd4212de32bfce394c464a677676d Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Fri, 15 Feb 2019 13:09:51 -0600 Subject: [PATCH] Address user directly in error messages --- backend/grant/proposal/views.py | 2 +- backend/grant/utils/auth.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/grant/proposal/views.py b/backend/grant/proposal/views.py index 787c19a7..896bacc2 100644 --- a/backend/grant/proposal/views.py +++ b/backend/grant/proposal/views.py @@ -100,7 +100,7 @@ def post_proposal_comments(proposal_id, comment, parent_comment_id): # Make sure user is not silenced if g.current_user.silenced: - return {"message": "User is silenced, cannot comment"}, 403 + return {"message": "Your account has been silenced, commenting is disabled."}, 403 # Make the comment comment = Comment( diff --git a/backend/grant/utils/auth.py b/backend/grant/utils/auth.py index 5ba2f92a..112bde74 100644 --- a/backend/grant/utils/auth.py +++ b/backend/grant/utils/auth.py @@ -23,7 +23,7 @@ def get_authed_user(): def throw_on_banned(user): if user.banned: - raise AuthException("User is banned") + raise AuthException("You are banned") def requires_auth(f):