Fix code style
This commit is contained in:
parent
e073b27bb1
commit
507c948e21
@ -1,9 +1,8 @@
|
||||
from service.api.dependencies import QueryParams
|
||||
from service.core.security import verify_password
|
||||
from service.crud.user.models import UserPublic, UserRegister
|
||||
from service.crud.utils import order_queryset
|
||||
from service.database.models import User
|
||||
from ..utils import order_queryset
|
||||
|
||||
from ...api.dependencies import QueryParams
|
||||
from .models import UserPublic, UserRegister
|
||||
|
||||
|
||||
async def authenticate(*, username: str, password: str) -> User | None:
|
||||
|
@ -4,5 +4,7 @@ from service.constants.types import PaginationParams
|
||||
|
||||
|
||||
def order_queryset(qs: QuerySet, filters: PaginationParams, default: str) -> QuerySet:
|
||||
ordering = None
|
||||
if filters.order:
|
||||
ordering = [f for f in filters.order.split(",") if f.split("-")[-1] in qs.fields]
|
||||
return qs.order_by(*(ordering or (default, )))
|
||||
|
Loading…
x
Reference in New Issue
Block a user