Skip to content

Commit

Permalink
[IMP] auth_jwt: pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
yankinmax committed Dec 15, 2021
1 parent ab2514c commit d7b4c03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions auth_jwt/models/auth_jwt_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _decode(self, token):
header = jwt.get_unverified_header(token)
except Exception as e:
_logger.info("Invalid token: %s", e)
raise UnauthorizedInvalidToken()
raise UnauthorizedInvalidToken() from e
key = self._get_key(header.get("kid"))
algorithm = self.public_key_algorithm
try:
Expand All @@ -133,7 +133,7 @@ def _decode(self, token):
)
except Exception as e:
_logger.info("Invalid token: %s", e)
raise UnauthorizedInvalidToken()
raise UnauthorizedInvalidToken() from e
return payload

def _get_uid(self, payload):
Expand Down Expand Up @@ -194,8 +194,8 @@ def _unregister_auth_method(self):
try:
delattr(IrHttp.__class__, f"_auth_method_jwt_{rec.name}")
delattr(IrHttp.__class__, f"_auth_method_public_or_jwt_{rec.name}")
except AttributeError:
pass
except AttributeError as e:
_logger.info("AttributeError: %s", e)

@api.model_create_multi
def create(self, vals):
Expand Down
1 change: 1 addition & 0 deletions auth_jwt/views/auth_jwt_validator_views.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" ?>
<!-- pylint:disable=xml-deprecated-tree-attribute -->
<odoo>
<record id="view_auth_jwt_validator_form" model="ir.ui.view">
<field name="name">auth.jwt.validator.form</field>
Expand Down

0 comments on commit d7b4c03

Please sign in to comment.