diff options
| author | Frederick Muriuki Muriithi | 2026-04-08 14:12:20 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2026-04-08 14:12:20 -0500 |
| commit | ad40f7c7050aac74361699ffa0e27b2fcb93873f (patch) | |
| tree | ddd57170f6737780c71907caeef3e39527fb21ef /gn_auth | |
| parent | 19d7c39e44097c2d9b31aba30fb97321db091385 (diff) | |
| download | gn-auth-ad40f7c7050aac74361699ffa0e27b2fcb93873f.tar.gz | |
Use module-level logger.
Diffstat (limited to 'gn_auth')
| -rw-r--r-- | gn_auth/auth/authorisation/users/views.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gn_auth/auth/authorisation/users/views.py b/gn_auth/auth/authorisation/users/views.py index c248ac3..cf2a8dc 100644 --- a/gn_auth/auth/authorisation/users/views.py +++ b/gn_auth/auth/authorisation/users/views.py @@ -1,5 +1,6 @@ """User authorisation endpoints.""" import uuid +import logging import sqlite3 import secrets import traceback @@ -57,6 +58,8 @@ from .models import list_users from .masquerade.views import masq from .collections.views import collections +logger = logging.getLogger(__name__) + users = Blueprint("users", __name__) users.register_blueprint(masq, url_prefix="/masquerade") users.register_blueprint(collections, url_prefix="/collections") @@ -235,11 +238,11 @@ def register_user() -> Response: redirect_uri=form["redirect_uri"]) return jsonify(asdict(user)) except sqlite3.IntegrityError as sq3ie: - current_app.logger.error(traceback.format_exc()) + logger.error(traceback.format_exc()) raise UserRegistrationError( "A user with that email already exists") from sq3ie except EmailNotValidError as enve: - current_app.logger.error(traceback.format_exc()) + logger.error(traceback.format_exc()) raise(UserRegistrationError(f"Email Error: {str(enve)}")) from enve raise Exception(# pylint: disable=[broad-exception-raised] |
