X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fauthconn_internal.py;fp=osm_nbi%2Fauthconn_internal.py;h=d039f84247d66bde3936f8d11b88c4e7a6fab8fa;hp=99d18e4ce256bc4f04370f186124da13de0be99a;hb=f2af4a100d308e07f355d61b94fb27d1ccc97aa2;hpb=838e4fb65f485469934a4dd895ca910470fa8beb diff --git a/osm_nbi/authconn_internal.py b/osm_nbi/authconn_internal.py index 99d18e4..d039f84 100644 --- a/osm_nbi/authconn_internal.py +++ b/osm_nbi/authconn_internal.py @@ -33,7 +33,11 @@ __date__ = "$06-jun-2019 11:16:08$" import logging import re -from osm_nbi.authconn import Authconn, AuthException, AuthconnConflictException # , AuthconnOperationException +from osm_nbi.authconn import ( + Authconn, + AuthException, + AuthconnConflictException, +) # , AuthconnOperationException from osm_common.dbbase import DbException from osm_nbi.base_topic import BaseTopic from osm_nbi.validation import is_valid_uuid @@ -380,11 +384,12 @@ class AuthconnInternal(Authconn): ) if old_pwd: salt = user_data["_admin"]["salt"] - shadow_password = sha256(old_pwd.encode('utf-8') + salt.encode('utf-8')).hexdigest() + shadow_password = sha256( + old_pwd.encode("utf-8") + salt.encode("utf-8") + ).hexdigest() if shadow_password != user_data["password"]: raise AuthconnConflictException( - "Incorrect password", - http_code=HTTPStatus.CONFLICT + "Incorrect password", http_code=HTTPStatus.CONFLICT ) BaseTopic.format_on_edit(user_data, user_info) # User Name