mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Do not apply fix for multichoice help text in later version of Django.
The initial fix could cause problems in Django 1.7 when serializers get used as a field. This is due to `force_text` being applied before full initialization of the apps registry (see #1907). The fix doesn't seem to be required after version 1.6: https://code.djangoproject.com/ticket/9321
This commit is contained in:
parent
ad1497898b
commit
2bad27231a
|
@ -11,6 +11,7 @@ import inspect
|
||||||
import re
|
import re
|
||||||
import warnings
|
import warnings
|
||||||
from decimal import Decimal, DecimalException
|
from decimal import Decimal, DecimalException
|
||||||
|
import django
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.core import validators
|
from django.core import validators
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
|
@ -143,7 +144,10 @@ class Field(object):
|
||||||
self.label = None
|
self.label = None
|
||||||
|
|
||||||
if help_text is not None:
|
if help_text is not None:
|
||||||
self.help_text = strip_multiple_choice_msg(smart_text(help_text))
|
help_text = smart_text(help_text)
|
||||||
|
if django.VERSION < (1, 6):
|
||||||
|
help_text = strip_multiple_choice_msg(help_text)
|
||||||
|
self.help_text = help_text
|
||||||
else:
|
else:
|
||||||
self.help_text = None
|
self.help_text = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user