Skip to content

Commit

Permalink
Merge pull request #6 from KhasanovBI/dev
Browse files Browse the repository at this point in the history
Remove rest_framework compat dependencies
  • Loading branch information
khasanovbi committed Jan 21, 2018
2 parents 033e2e4 + 6eb7c98 commit 5af57cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rest_channels/parsers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# coding=utf-8
from __future__ import unicode_literals

import six
import ujson
from rest_framework.compat import six
from rest_framework.exceptions import ParseError
from rest_framework.renderers import JSONRenderer

Expand Down
9 changes: 7 additions & 2 deletions rest_channels/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@
from functools import update_wrapper

import six
from django.db import models
from django.db import connection, models, transaction
from rest_framework import exceptions, status
from rest_framework.compat import set_rollback

from rest_channels import exceptions as rest_exceptions
from rest_channels.settings import rest_channels_settings
from rest_channels.socket_request import ContentType, SocketRequest


def set_rollback():
atomic_requests = connection.settings_dict.get('ATOMIC_REQUESTS', False)
if atomic_requests and connection.in_atomic_block:
transaction.set_rollback(True)


def exception_handler(exc, context):
if isinstance(exc, exceptions.APIException):
if isinstance(exc.detail, dict):
Expand Down

0 comments on commit 5af57cb

Please sign in to comment.