Enable pylint, black and flake8 in tox.ini
[osm/NBI.git] / osm_nbi / authconn_internal.py
index 99d18e4..d039f84 100644 (file)
@@ -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