Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 31, 2024
1 parent 76741ff commit 293040e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rest_framework_simplejwt/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ def verify(self, *args, **kwargs) -> None:

def check_user_active(self):
user_id = self.payload.get(api_settings.USER_ID_CLAIM, None)
if user_id and not get_user_model().objects.get(**{api_settings.USER_ID_FIELD: user_id}).is_active:
if (
user_id
and not get_user_model()
.objects.get(**{api_settings.USER_ID_FIELD: user_id})
.is_active
):
raise TokenError(_("User is inactive"))

def check_blacklist(self) -> None:
Expand Down

0 comments on commit 293040e

Please sign in to comment.