diff --git a/taiga/projects/api.py b/taiga/projects/api.py index d92806d7..23977e6d 100644 --- a/taiga/projects/api.py +++ b/taiga/projects/api.py @@ -18,7 +18,7 @@ import uuid from django.db.models import Q, signals from django.utils.translation import ugettext_lazy as _ -from django.shortcuts import get_object_or_404 +from taiga.base.api.utils import get_object_or_404 from django.db import transaction as tx from django.core.exceptions import ValidationError diff --git a/taiga/projects/attachments/api.py b/taiga/projects/attachments/api.py index a63b3aa4..2c89d57f 100644 --- a/taiga/projects/attachments/api.py +++ b/taiga/projects/attachments/api.py @@ -21,7 +21,7 @@ import mimetypes mimetypes.init() from django.contrib.contenttypes.models import ContentType -from django.shortcuts import get_object_or_404 +from taiga.base.api.utils import get_object_or_404 from django.conf import settings from django import http diff --git a/taiga/projects/history/api.py b/taiga/projects/history/api.py index ad011af9..078f1f63 100644 --- a/taiga/projects/history/api.py +++ b/taiga/projects/history/api.py @@ -15,12 +15,12 @@ # along with this program. If not, see . from django.contrib.contenttypes.models import ContentType -from django.shortcuts import get_object_or_404 from django.utils import timezone from rest_framework.response import Response from rest_framework import status +from taiga.base.api.utils import get_object_or_404 from taiga.base.decorators import detail_route from taiga.base.api import ReadOnlyListViewSet diff --git a/taiga/projects/issues/api.py b/taiga/projects/issues/api.py index cdae587f..eb2dedcc 100644 --- a/taiga/projects/issues/api.py +++ b/taiga/projects/issues/api.py @@ -15,13 +15,13 @@ # along with this program. If not, see . from django.utils.translation import ugettext_lazy as _ -from django.shortcuts import get_object_or_404 from django.db.models import Q from django.http import Http404 from rest_framework.response import Response from rest_framework import status +from taiga.base.api.utils import get_object_or_404 from taiga.base import filters, response from taiga.base import exceptions as exc from taiga.base.decorators import detail_route, list_route diff --git a/taiga/projects/milestones/api.py b/taiga/projects/milestones/api.py index d669a5bf..3e26309d 100644 --- a/taiga/projects/milestones/api.py +++ b/taiga/projects/milestones/api.py @@ -15,11 +15,11 @@ # along with this program. If not, see . from django.utils.translation import ugettext_lazy as _ -from django.shortcuts import get_object_or_404 from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response +from taiga.base.api.utils import get_object_or_404 from taiga.base import filters from taiga.base import exceptions as exc from taiga.base.decorators import detail_route diff --git a/taiga/projects/notifications/api.py b/taiga/projects/notifications/api.py index a6cf8e52..e2c0e91e 100644 --- a/taiga/projects/notifications/api.py +++ b/taiga/projects/notifications/api.py @@ -15,12 +15,12 @@ # along with this program. If not, see . from django.utils.translation import ugettext_lazy as _ -from django.shortcuts import get_object_or_404 from django.db.models import Q from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response +from taiga.base.api.utils import get_object_or_404 from taiga.base import filters from taiga.base import exceptions as exc from taiga.base.decorators import detail_route diff --git a/taiga/projects/references/api.py b/taiga/projects/references/api.py index ad8f7169..8e53e179 100644 --- a/taiga/projects/references/api.py +++ b/taiga/projects/references/api.py @@ -15,10 +15,10 @@ # along with this program. If not, see . from django.apps import apps -from django.shortcuts import get_object_or_404 from rest_framework.response import Response +from taiga.base.api.utils import get_object_or_404 from taiga.base import exceptions as exc from taiga.base.api import viewsets from .serializers import ResolverSerializer diff --git a/taiga/projects/tasks/api.py b/taiga/projects/tasks/api.py index a4e6361d..a2adf9e9 100644 --- a/taiga/projects/tasks/api.py +++ b/taiga/projects/tasks/api.py @@ -15,8 +15,8 @@ # along with this program. If not, see . from django.utils.translation import ugettext_lazy as _ -from django.shortcuts import get_object_or_404 +from taiga.base.api.utils import get_object_or_404 from taiga.base import filters, response from taiga.base import exceptions as exc from taiga.base.decorators import list_route diff --git a/taiga/projects/userstories/api.py b/taiga/projects/userstories/api.py index e667355d..b0725f68 100644 --- a/taiga/projects/userstories/api.py +++ b/taiga/projects/userstories/api.py @@ -19,12 +19,12 @@ from contextlib import suppress from django.apps import apps from django.db import transaction from django.utils.translation import ugettext as _ -from django.shortcuts import get_object_or_404 from django.core.exceptions import ObjectDoesNotExist from rest_framework.response import Response from rest_framework import status +from taiga.base.api.utils import get_object_or_404 from taiga.base import filters, response from taiga.base import exceptions as exc from taiga.base.decorators import list_route diff --git a/taiga/projects/wiki/api.py b/taiga/projects/wiki/api.py index 8ce56eac..45b7f5a2 100644 --- a/taiga/projects/wiki/api.py +++ b/taiga/projects/wiki/api.py @@ -15,12 +15,12 @@ # along with this program. If not, see . from django.utils.translation import ugettext_lazy as _ -from django.shortcuts import get_object_or_404 from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework import status +from taiga.base.api.utils import get_object_or_404 from taiga.base import filters from taiga.base import exceptions as exc from taiga.base.api import ModelCrudViewSet diff --git a/taiga/timeline/api.py b/taiga/timeline/api.py index 2db4c7f6..10795cef 100644 --- a/taiga/timeline/api.py +++ b/taiga/timeline/api.py @@ -15,10 +15,10 @@ # along with this program. If not, see . from django.contrib.contenttypes.models import ContentType -from django.shortcuts import get_object_or_404 from rest_framework.response import Response +from taiga.base.api.utils import get_object_or_404 from taiga.base.api import GenericViewSet from . import serializers diff --git a/taiga/users/api.py b/taiga/users/api.py index 6407b8b9..6afd5674 100644 --- a/taiga/users/api.py +++ b/taiga/users/api.py @@ -18,7 +18,6 @@ import uuid from django.apps import apps from django.db.models import Q -from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext_lazy as _ from django.core.validators import validate_email from django.core.exceptions import ValidationError @@ -26,7 +25,6 @@ from django.conf import settings from easy_thumbnails.source_generators import pil_image - from rest_framework.response import Response from rest_framework.filters import BaseFilterBackend from rest_framework import status @@ -37,6 +35,7 @@ from taiga.auth.tokens import get_user_for_token from taiga.base.decorators import list_route, detail_route from taiga.base import exceptions as exc from taiga.base.api import ModelCrudViewSet +from taiga.base.api.utils import get_object_or_404 from taiga.base.utils.slug import slugify_uniquely from taiga.projects.votes import services as votes_service from taiga.projects.serializers import StarredSerializer diff --git a/taiga/webhooks/api.py b/taiga/webhooks/api.py index cd219574..31242102 100644 --- a/taiga/webhooks/api.py +++ b/taiga/webhooks/api.py @@ -16,12 +16,11 @@ import json -from django.shortcuts import get_object_or_404 - from rest_framework.response import Response from taiga.base import filters from taiga.base.api import ModelCrudViewSet, ModelListViewSet +from taiga.base.api.utils import get_object_or_404 from taiga.base.decorators import detail_route from . import models