def get_user(self, validated_token):
    '\n        Attempts to find and return a user using the given validated token.\n        '
    try:
        user_id = validated_token[api_settings.USER_ID_CLAIM]
    except KeyError:
        raise InvalidToken(_('Token contained no recognizable user identification'))
    try:
        user = self.user_model.objects.get(**{api_settings.USER_ID_FIELD: user_id})
    except self.user_model.DoesNotExist:
        raise AuthenticationFailed(_('User not found'), code='user_not_found')
    if (not user.is_active):
        raise AuthenticationFailed(_('User is inactive'), code='user_inactive')
    return user
Attempts to find and return a user using the given validated token.
def get_user(self, validated_token):
    '\n        \n        '
    try:
        user_id = validated_token[api_settings.USER_ID_CLAIM]
    except KeyError:
        raise InvalidToken(_('Token contained no recognizable user identification'))
    try:
        user = self.user_model.objects.get(**{api_settings.USER_ID_FIELD: user_id})
    except self.user_model.DoesNotExist:
        raise AuthenticationFailed(_('User not found'), code='user_not_found')
    if (not user.is_active):
        raise AuthenticationFailed(_('User is inactive'), code='user_inactive')
    return user