Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Fix rest_framework import sentences #9

Merged
merged 1 commit into from
Apr 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions back/taiga_contrib_hipchat/compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (C) 2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2015 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.


# Serializers
try:
from taiga.base.api import serializers
except ImportError:
from rest_framework import serializers


# UnicodeJSONRenderer
try:
from taiga.base.api.renderers import UnicodeJSONRenderer
except ImportError:
from rest_framework import UnicodeJSONRenderer
3 changes: 1 addition & 2 deletions back/taiga_contrib_hipchat/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from rest_framework import serializers

from .compat import serializers
from .models import HipChatHook


Expand Down
5 changes: 2 additions & 3 deletions back/taiga_contrib_hipchat/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
from django.conf import settings
from django.template import loader, Context


from rest_framework.renderers import UnicodeJSONRenderer

from taiga.base.utils.db import get_typename_for_model_instance
from taiga.celery import app

from .compat import UnicodeJSONRenderer


logger = logging.getLogger(__name__)

Expand Down