# -*- coding: utf-8 -*-

"""Managers for OAuth models."""

from django.db import models

from readthedocs.core.utils.extend import SettingsOverrideObject


class RelatedUserQuerySetBase(models.QuerySet):

    """For models with relations through :py:class:`User`."""

    def api(self, user=None):
        """Return objects for user."""
        if not user.is_authenticated:
            return self.none()
        return self.filter(users=user)


class RelatedUserQuerySet(SettingsOverrideObject):
    _default_class = RelatedUserQuerySetBase
    _override_setting = 'RELATED_USER_MANAGER'


class RemoteRepositoryQuerySet(RelatedUserQuerySet):
    pass


class RemoteOrganizationQuerySet(RelatedUserQuerySet):
    pass

e61f49a96b6e9a0577d9281780fbeb0096c5ac66
<mask token>


class RelatedUserQuerySet(SettingsOverrideObject):
    _default_class = RelatedUserQuerySetBase
    _override_setting = 'RELATED_USER_MANAGER'


class RemoteRepositoryQuerySet(RelatedUserQuerySet):
    pass


class RemoteOrganizationQuerySet(RelatedUserQuerySet):
    pass

<mask token>


class RelatedUserQuerySetBase(models.QuerySet):
    <mask token>

    def api(self, user=None):
        """Return objects for user."""
        if not user.is_authenticated:
            return self.none()
        return self.filter(users=user)


class RelatedUserQuerySet(SettingsOverrideObject):
    _default_class = RelatedUserQuerySetBase
    _override_setting = 'RELATED_USER_MANAGER'


class RemoteRepositoryQuerySet(RelatedUserQuerySet):
    pass


class RemoteOrganizationQuerySet(RelatedUserQuerySet):
    pass

<mask token>


class RelatedUserQuerySetBase(models.QuerySet):
    """For models with relations through :py:class:`User`."""

    def api(self, user=None):
        """Return objects for user."""
        if not user.is_authenticated:
            return self.none()
        return self.filter(users=user)


class RelatedUserQuerySet(SettingsOverrideObject):
    _default_class = RelatedUserQuerySetBase
    _override_setting = 'RELATED_USER_MANAGER'


class RemoteRepositoryQuerySet(RelatedUserQuerySet):
    pass


class RemoteOrganizationQuerySet(RelatedUserQuerySet):
    pass

<mask token>
from django.db import models
from readthedocs.core.utils.extend import SettingsOverrideObject


class RelatedUserQuerySetBase(models.QuerySet):
    """For models with relations through :py:class:`User`."""

    def api(self, user=None):
        """Return objects for user."""
        if not user.is_authenticated:
            return self.none()
        return self.filter(users=user)


class RelatedUserQuerySet(SettingsOverrideObject):
    _default_class = RelatedUserQuerySetBase
    _override_setting = 'RELATED_USER_MANAGER'


class RemoteRepositoryQuerySet(RelatedUserQuerySet):
    pass


class RemoteOrganizationQuerySet(RelatedUserQuerySet):
    pass

# -*- coding: utf-8 -*-

"""Managers for OAuth models."""

from django.db import models

from readthedocs.core.utils.extend import SettingsOverrideObject


class RelatedUserQuerySetBase(models.QuerySet):

    """For models with relations through :py:class:`User`."""

    def api(self, user=None):
        """Return objects for user."""
        if not user.is_authenticated:
            return self.none()
        return self.filter(users=user)


class RelatedUserQuerySet(SettingsOverrideObject):
    _default_class = RelatedUserQuerySetBase
    _override_setting = 'RELATED_USER_MANAGER'


class RemoteRepositoryQuerySet(RelatedUserQuerySet):
    pass


class RemoteOrganizationQuerySet(RelatedUserQuerySet):
    pass
