from django.core.exceptions import ObjectDoesNotExist

from .models import Users


async def get_user_by_id(user_id: str) -> Users | None:
    try:
        return await Users.objects.aget(user_id=user_id)
    except ObjectDoesNotExist:
        return None
