Removed unnecessary utc wrapper. (#4839)

This commit is contained in:
Mariusz Felisiak 2017-01-23 17:22:32 +01:00 committed by Tom Christie
parent 247954d497
commit 5c0f9f147c
3 changed files with 3 additions and 11 deletions

View File

@ -312,12 +312,3 @@ def set_many(instance, field, value):
else:
field = getattr(instance, field)
field.set(value)
try:
# A `utc` instance is available in Django 1.11+
from django.utils.timezone import utc
except ImportError:
# A `UTC` class is available in older versions
from django.utils.timezone import UTC
utc = UTC()

View File

@ -28,11 +28,12 @@ from django.utils.encoding import is_protected_type, smart_text
from django.utils.formats import localize_input, sanitize_separators
from django.utils.functional import cached_property
from django.utils.ipv6 import clean_ipv6_address
from django.utils.timezone import utc
from django.utils.translation import ugettext_lazy as _
from rest_framework import ISO_8601
from rest_framework.compat import (
get_remote_field, unicode_repr, unicode_to_repr, utc, value_from_object
get_remote_field, unicode_repr, unicode_to_repr, value_from_object
)
from rest_framework.exceptions import ErrorDetail, ValidationError
from rest_framework.settings import api_settings

View File

@ -9,10 +9,10 @@ import pytest
from django.http import QueryDict
from django.test import TestCase, override_settings
from django.utils import six
from django.utils.timezone import utc
import rest_framework
from rest_framework import serializers
from rest_framework.compat import utc
from rest_framework.fields import is_simple_callable
try: