feat(kanidm): Use an async function to get the data
This commit is contained in:
parent
b5cedebda1
commit
a9d369d55d
1 changed files with 4 additions and 3 deletions
|
@ -88,12 +88,13 @@ class User(AbstractUser):
|
|||
# accepted_terms = models.ManyToManyField(TermsAndConditions)
|
||||
|
||||
@cached_property
|
||||
def kanidm(self) -> Optional[KanidmProfile]:
|
||||
@async_to_sync
|
||||
async def kanidm(self) -> Optional[KanidmProfile]:
|
||||
try:
|
||||
radius_data = async_to_sync(client.get_radius_token)(self.username).data
|
||||
radius_data = (await client.get_radius_token(self.username)).data
|
||||
|
||||
return KanidmProfile(
|
||||
person=async_to_sync(client.person_account_get)(self.username),
|
||||
person=(await client.person_account_get(self.username)),
|
||||
radius_secret=radius_data and radius_data.get("secret"),
|
||||
)
|
||||
except NoMatchingEntries:
|
||||
|
|
Loading…
Reference in a new issue