Update error message

This commit is contained in:
M.Ravi 2017-10-01 20:32:51 +02:00
parent 167eaf2a0c
commit 06b1ce9e72

View file

@ -1143,8 +1143,9 @@ def forbidden_view(request, exception=None, reason=''):
Handle 403 error
"""
logger.error(str(exception) if exception else None)
all_messages = messages.get_messages(request)
messages.add_message(request, messages.ERROR, reason)
err_msg = _('There was an error processing your request. Please try '
'again. Details: {reason}'.format(reason=reason))
messages.add_message(request, messages.ERROR, err_msg)
return HttpResponseRedirect(
request.get_full_path()
)