Following django async style-guide for user services

This commit is contained in:
Maximilian Giller 2024-02-28 14:00:53 +01:00
parent 864a7741e6
commit 398a2c7c08

View file

@ -3,7 +3,7 @@ from django.contrib.auth.models import User
from typing import Optional
async def create_user_information(user: User, *, display_name: Optional[str] = None) -> UserInformation:
async def acreate_user_information(user: User, *, display_name: Optional[str] = None) -> UserInformation:
"""Async. Create a UserInformation object for the given user.
@param user: The user to create the UserInformation object for.
@ -20,7 +20,7 @@ async def create_user_information(user: User, *, display_name: Optional[str] = N
return user_information
async def get_user_information(user: User) -> UserInformation:
async def aget_user_information(user: User) -> UserInformation:
"""Async. Get the UserInformation object for the given user.
@param user: The user to get the UserInformation object for.
@ -29,7 +29,7 @@ async def get_user_information(user: User) -> UserInformation:
return await UserInformation.objects.aget(user)
async def set_user_display_name(user: User, display_name: Optional[str] = None) -> UserInformation:
async def aset_user_display_name(user: User, display_name: Optional[str] = None) -> UserInformation:
"""Async. Set the display name for the given user.
@param user: The user to set the display name for.