Skip to content

Commit

Permalink
Use force_str instead of force_text that cause RemovedInDjango40Warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogost committed Jul 6, 2020
1 parent a137e65 commit 0759608
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions datatableview/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Manager, Model, Q
from django.http import HttpResponse, HttpResponseBadRequest
from django.utils.encoding import force_text
from django.utils.encoding import force_str
from django.utils.text import smart_split
from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.generic.list import ListView, MultipleObjectMixin
Expand Down Expand Up @@ -492,11 +492,11 @@ def _get_resolver_method(self, i, column):
return True, getattr(self, callback)

# Treat the 'nice name' as the starting point for looking up a method
name = force_text(column.pretty_name, errors="ignore")
name = force_str(column.pretty_name, errors="ignore")
if not name:
name = column.fields[0]

mangled_name = re.sub(r'[\W_]+', '_', force_text(name))
mangled_name = re.sub(r'[\W_]+', '_', force_str(name))

f = getattr(self, 'get_column_%s_data' % mangled_name, None)
if f:
Expand Down

0 comments on commit 0759608

Please sign in to comment.