fix kanidm token bug

This commit is contained in:
Inex Code 2025-01-10 03:50:46 +03:00
parent 73359af512
commit 178afef625
No known key found for this signature in database

View file

@ -3,7 +3,7 @@ from typing import Any, Optional, Union
import subprocess import subprocess
import re import re
import logging import logging
import requests # type: ignore import requests
from selfprivacy_api.models.group import Group from selfprivacy_api.models.group import Group
from selfprivacy_api.repositories.users.exceptions import ( from selfprivacy_api.repositories.users.exceptions import (
@ -62,7 +62,7 @@ class KanidmAdminToken:
@staticmethod @staticmethod
def get() -> str: def get() -> str:
kanidm_admin_token = str(redis.get(REDIS_TOKEN_KEY)) kanidm_admin_token: str | None = redis.get(REDIS_TOKEN_KEY) # type: ignore
if kanidm_admin_token is None or not KanidmAdminToken._is_token_valid( if kanidm_admin_token is None or not KanidmAdminToken._is_token_valid(
kanidm_admin_token kanidm_admin_token