diff --git a/readthedocs/api/v3/mixins.py b/readthedocs/api/v3/mixins.py index 2f583d6217f..a1916fdd74d 100644 --- a/readthedocs/api/v3/mixins.py +++ b/readthedocs/api/v3/mixins.py @@ -1,4 +1,3 @@ -from django.contrib.auth.models import User from django.shortcuts import get_object_or_404 from rest_framework.exceptions import NotFound diff --git a/readthedocs/api/v3/urls.py b/readthedocs/api/v3/urls.py index 71b545a3201..f577b44abe2 100644 --- a/readthedocs/api/v3/urls.py +++ b/readthedocs/api/v3/urls.py @@ -1,7 +1,7 @@ from .routers import DefaultRouterWithNesting from .views import ( - BuildsViewSet, BuildsCreateViewSet, + BuildsViewSet, ProjectsViewSet, SubprojectRelationshipViewSet, TranslationRelationshipViewSet, diff --git a/readthedocs/api/v3/views.py b/readthedocs/api/v3/views.py index fcf041e9abd..8657807a0a6 100644 --- a/readthedocs/api/v3/views.py +++ b/readthedocs/api/v3/views.py @@ -163,9 +163,7 @@ def get_view_description(self, *args, **kwargs): # pylint: disable=arguments-di @action(detail=True, methods=['get']) def superproject(self, request, project_slug): - """ - Return the superproject of a ``Project``. - """ + """Return the superproject of a ``Project``.""" project = self.get_object() try: superproject = project.superprojects.first().parent @@ -180,15 +178,15 @@ class SubprojectRelationshipViewSet(APIv3Settings, ProjectQuerySetMixin, ListModelMixin, GenericViewSet): # Markdown docstring exposed at BrowsableAPIRenderer. - """ - List subprojects of a ``Project``. - """ + + """List subprojects of a ``Project``.""" # Private/Internal docstring + """ The main query is done via the ``NestedViewSetMixin`` using the ``parents_query_lookups`` defined when registering the urls. - """ + """ # noqa model = Project lookup_field = 'slug' @@ -202,15 +200,14 @@ class TranslationRelationshipViewSet(APIv3Settings, ProjectQuerySetMixin, ListModelMixin, GenericViewSet): # Markdown docstring exposed at BrowsableAPIRenderer. - """ - List translations of a ``Project``. - """ + + """List translations of a ``Project``.""" # Private/Internal docstring """ The main query is done via the ``NestedViewSetMixin`` using the ``parents_query_lookups`` defined when registering the urls. - """ + """ # noqa model = Project lookup_field = 'slug' diff --git a/readthedocs/oauth/services/gitlab.py b/readthedocs/oauth/services/gitlab.py index dfc82aced12..2748ec1fda2 100644 --- a/readthedocs/oauth/services/gitlab.py +++ b/readthedocs/oauth/services/gitlab.py @@ -11,14 +11,12 @@ from readthedocs.builds.utils import get_gitlab_username_repo from readthedocs.integrations.models import Integration -from readthedocs.integrations.utils import get_secret from readthedocs.projects.models import Project from ..models import RemoteOrganization, RemoteRepository from .base import Service, SyncServiceError - try: from urlparse import urljoin, urlparse except ImportError: