Allow to extend ProjectsViewSet
@@ -21,6 +21,7 @@ from rest_framework_extensions.mixins import NestedViewSetMixin
from readthedocs.builds.models import Build, Version
from readthedocs.core.utils import trigger_build
+from readthedocs.core.utils.extend import SettingsOverrideObject
from readthedocs.projects.models import Project, EnvironmentVariable, ProjectRelationship
from readthedocs.projects.views.mixins import ProjectImportMixin
from readthedocs.redirects.models import Redirect
@@ -75,7 +76,7 @@ class APIv3Settings:
metadata_class = SimpleMetadata
-class ProjectsViewSet(APIv3Settings, NestedViewSetMixin, ProjectQuerySetMixin,
+class ProjectsViewSetBase(APIv3Settings, NestedViewSetMixin, ProjectQuerySetMixin,
FlexFieldsMixin, ProjectImportMixin, CreateModelMixin,
UpdateMixin, UpdateModelMixin,
ReadOnlyModelViewSet):
@@ -165,6 +166,11 @@ class ProjectsViewSet(APIv3Settings, NestedViewSetMixin, ProjectQuerySetMixin,
return Response(status=status.HTTP_404_NOT_FOUND)
+
+class ProjectsViewSet(SettingsOverrideObject):
+ _default_class = ProjectsViewSetBase
+
+
class SubprojectRelationshipViewSet(APIv3Settings, NestedViewSetMixin,
ProjectQuerySetMixin, FlexFieldsMixin,
CreateModelMixin, DestroyModelMixin,
