[Python-modules-commits] [django-polymorphic] 08/17: Replace force_unicode with force_text.
Michael Fladischer
fladi at moszumanska.debian.org
Mon Mar 6 12:51:40 UTC 2017
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch experimental
in repository django-polymorphic.
commit b03e249f8b3d9030a19704563afb2cd638325673
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Mon Mar 6 12:24:52 2017 +0100
Replace force_unicode with force_text.
The helper function `force_text` supersedes `force_unicode` as the later is only
applicable in a Python2 context.
---
docs/_ext/djangoext/docstrings.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/_ext/djangoext/docstrings.py b/docs/_ext/djangoext/docstrings.py
index 5ae5bf1..b626b73 100644
--- a/docs/_ext/djangoext/docstrings.py
+++ b/docs/_ext/djangoext/docstrings.py
@@ -4,7 +4,7 @@ Based on http://djangosnippets.org/snippets/2533/
"""
import django
from django.utils.html import strip_tags
-from django.utils.encoding import force_unicode
+from django.utils.encoding import force_text
import inspect
@@ -20,8 +20,8 @@ def improve_model_docstring(app, what, name, obj, options, lines):
model_fields = obj._meta._fields()
for field in model_fields:
- help_text = strip_tags(force_unicode(field.help_text))
- verbose_name = force_unicode(field.verbose_name).capitalize()
+ help_text = strip_tags(force_text(field.help_text))
+ verbose_name = force_text(field.verbose_name).capitalize()
# Add parameter
if help_text:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-polymorphic.git
More information about the Python-modules-commits
mailing list