Merge pull request #228 from taigaio/refactor/use_our_get_object_or_404_function

Use our get_object_or_404 function instead the django one
remotes/origin/enhancement/email-actions
Jesús Espino 2015-02-02 16:10:27 +01:00
commit c2416dd622
13 changed files with 13 additions and 15 deletions

View File

@ -18,7 +18,7 @@ import uuid
from django.db.models import Q, signals from django.db.models import Q, signals
from django.utils.translation import ugettext_lazy as _ 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.db import transaction as tx
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError

View File

@ -21,7 +21,7 @@ import mimetypes
mimetypes.init() mimetypes.init()
from django.contrib.contenttypes.models import ContentType 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.conf import settings
from django import http from django import http

View File

@ -15,12 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.shortcuts import get_object_or_404
from django.utils import timezone from django.utils import timezone
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework import status 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.decorators import detail_route
from taiga.base.api import ReadOnlyListViewSet from taiga.base.api import ReadOnlyListViewSet

View File

@ -15,13 +15,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.shortcuts import get_object_or_404
from django.db.models import Q from django.db.models import Q
from django.http import Http404 from django.http import Http404
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework import status 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 filters, response
from taiga.base import exceptions as exc from taiga.base import exceptions as exc
from taiga.base.decorators import detail_route, list_route from taiga.base.decorators import detail_route, list_route

View File

@ -15,11 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.utils.translation import ugettext_lazy as _ 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.permissions import IsAuthenticated
from rest_framework.response import Response 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 filters
from taiga.base import exceptions as exc from taiga.base import exceptions as exc
from taiga.base.decorators import detail_route from taiga.base.decorators import detail_route

View File

@ -15,12 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.shortcuts import get_object_or_404
from django.db.models import Q from django.db.models import Q
from rest_framework.permissions import IsAuthenticated from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response 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 filters
from taiga.base import exceptions as exc from taiga.base import exceptions as exc
from taiga.base.decorators import detail_route from taiga.base.decorators import detail_route

View File

@ -15,10 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.apps import apps from django.apps import apps
from django.shortcuts import get_object_or_404
from rest_framework.response import Response 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 import exceptions as exc
from taiga.base.api import viewsets from taiga.base.api import viewsets
from .serializers import ResolverSerializer from .serializers import ResolverSerializer

View File

@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.utils.translation import ugettext_lazy as _ 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 filters, response
from taiga.base import exceptions as exc from taiga.base import exceptions as exc
from taiga.base.decorators import list_route from taiga.base.decorators import list_route

View File

@ -19,12 +19,12 @@ from contextlib import suppress
from django.apps import apps from django.apps import apps
from django.db import transaction from django.db import transaction
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.shortcuts import get_object_or_404
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework import status 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 filters, response
from taiga.base import exceptions as exc from taiga.base import exceptions as exc
from taiga.base.decorators import list_route from taiga.base.decorators import list_route

View File

@ -15,12 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.utils.translation import ugettext_lazy as _ 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.permissions import IsAuthenticated
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework import status from rest_framework import status
from taiga.base.api.utils import get_object_or_404
from taiga.base import filters from taiga.base import filters
from taiga.base import exceptions as exc from taiga.base import exceptions as exc
from taiga.base.api import ModelCrudViewSet from taiga.base.api import ModelCrudViewSet

View File

@ -15,10 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.shortcuts import get_object_or_404
from rest_framework.response import Response from rest_framework.response import Response
from taiga.base.api.utils import get_object_or_404
from taiga.base.api import GenericViewSet from taiga.base.api import GenericViewSet
from . import serializers from . import serializers

View File

@ -18,7 +18,6 @@ import uuid
from django.apps import apps from django.apps import apps
from django.db.models import Q from django.db.models import Q
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.core.validators import validate_email from django.core.validators import validate_email
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
@ -26,7 +25,6 @@ from django.conf import settings
from easy_thumbnails.source_generators import pil_image from easy_thumbnails.source_generators import pil_image
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework.filters import BaseFilterBackend from rest_framework.filters import BaseFilterBackend
from rest_framework import status 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.decorators import list_route, detail_route
from taiga.base import exceptions as exc from taiga.base import exceptions as exc
from taiga.base.api import ModelCrudViewSet 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.base.utils.slug import slugify_uniquely
from taiga.projects.votes import services as votes_service from taiga.projects.votes import services as votes_service
from taiga.projects.serializers import StarredSerializer from taiga.projects.serializers import StarredSerializer

View File

@ -16,12 +16,11 @@
import json import json
from django.shortcuts import get_object_or_404
from rest_framework.response import Response from rest_framework.response import Response
from taiga.base import filters from taiga.base import filters
from taiga.base.api import ModelCrudViewSet, ModelListViewSet 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 taiga.base.decorators import detail_route
from . import models from . import models