Skip to content

Commit a58a6b9

Browse files
committed
Migrate database_sync_to_async to async def for auth.pyi functions
1 parent 8417525 commit a58a6b9

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

stubs/channels/channels/auth.pyi

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@ from django.contrib.auth.models import AnonymousUser
88
from django.utils.functional import LazyObject
99

1010
from .consumer import _ChannelScope, _LazySession
11-
from .db import database_sync_to_async
1211
from .utils import _ChannelApplication
1312

14-
@database_sync_to_async
15-
def get_user(scope: _ChannelScope) -> AbstractBaseUser | AnonymousUser: ...
16-
@database_sync_to_async
17-
def login(scope: _ChannelScope, user: AbstractBaseUser, backend: BaseBackend | None = ...) -> None: ...
18-
@database_sync_to_async
19-
def logout(scope: _ChannelScope) -> None: ...
13+
async def get_user(scope: _ChannelScope) -> AbstractBaseUser | AnonymousUser: ...
14+
async def login(scope: _ChannelScope, user: AbstractBaseUser, backend: BaseBackend | None = ...) -> None: ...
15+
async def logout(scope: _ChannelScope) -> None: ...
2016
def _get_user_session_key(session: _LazySession) -> Any: ...
2117

2218
class UserLazyObject(AbstractBaseUser, LazyObject):

0 commit comments

Comments
 (0)