Skip to content

Commit

Permalink
Merge pull request #6346 from OCHA-DAP/feature/hdx-9249
Browse files Browse the repository at this point in the history
HDX-9249 all logins are logged as warn
  • Loading branch information
danmihaila authored Jun 5, 2024
2 parents 7a36567 + 4ef125a commit 5536bb2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ckanext-hdx_users/ckanext/hdx_users/views/signin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Union, Any, Optional, Mapping
from urllib.parse import quote

import logging
from flask import Blueprint, Response

from ckan.common import session
Expand All @@ -18,6 +18,8 @@

hdx_signin = Blueprint(u'hdx_signin', __name__, url_prefix=u'/')

log = logging.getLogger(__name__)

abort = tk.abort
render = tk.render
request = tk.request
Expand Down Expand Up @@ -130,9 +132,11 @@ def login() -> Union[Response, str]:
session['from_login'] = True
res = next_page_or_default(next)
_remember_user_for_next_signin(res, user_obj)
log.warning(f'Login succeeded for: {username_or_email}')
return res
else:
extra_vars['error_message'] = _(u"Login failed. Bad username or password.")
log.warning(f'Login failed for: {username_or_email} . Bad username or password.')
return render("user/signin.html", extra_vars=extra_vars)

info_message_type = request.args.get('info_message_type')
Expand Down

0 comments on commit 5536bb2

Please sign in to comment.