Fix TypeError on Python 3 when querystring is preserved in the admin.
Fixes: #263fix_request_path_info
parent
490f968353
commit
a8bfb5007e
|
|
@ -359,7 +359,9 @@ class PolymorphicParentModelAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
extra_qs = ''
|
extra_qs = ''
|
||||||
if request.META['QUERY_STRING']:
|
if request.META['QUERY_STRING']:
|
||||||
extra_qs = '&' + request.META['QUERY_STRING']
|
# QUERY_STRING is bytes in Python 3, using force_text() to decode it as string.
|
||||||
|
# See QueryDict how Django deals with that.
|
||||||
|
extra_qs = '&{0}'.format(force_text(request.META['QUERY_STRING']))
|
||||||
|
|
||||||
choices = self.get_child_type_choices(request, 'add')
|
choices = self.get_child_type_choices(request, 'add')
|
||||||
if len(choices) == 1:
|
if len(choices) == 1:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue