aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-django-oscar/0007-Fix-widgets.ImageInput-for-Django-1.11.patch
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2017-07-20 16:20:14 +0300
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2017-07-20 16:22:47 +0300
commit4388c2d4c492d82d3c339b51a1317b00f8a84ae6 (patch)
tree33a1130e1ed2e460a69f05dcd3062091ad12dcb7 /main/py-django-oscar/0007-Fix-widgets.ImageInput-for-Django-1.11.patch
parent3657983b41b84bbfa571935652fb766d8233b8ae (diff)
downloadaports-4388c2d4c492d82d3c339b51a1317b00f8a84ae6.tar.bz2
aports-4388c2d4c492d82d3c339b51a1317b00f8a84ae6.tar.xz
main/py-django-oscar: backport support for Django 1.11
Diffstat (limited to 'main/py-django-oscar/0007-Fix-widgets.ImageInput-for-Django-1.11.patch')
-rw-r--r--main/py-django-oscar/0007-Fix-widgets.ImageInput-for-Django-1.11.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/main/py-django-oscar/0007-Fix-widgets.ImageInput-for-Django-1.11.patch b/main/py-django-oscar/0007-Fix-widgets.ImageInput-for-Django-1.11.patch
new file mode 100644
index 0000000000..c47f8a33e0
--- /dev/null
+++ b/main/py-django-oscar/0007-Fix-widgets.ImageInput-for-Django-1.11.patch
@@ -0,0 +1,31 @@
+From b7a50dce837006f8643e59a40a164a75010138e8 Mon Sep 17 00:00:00 2001
+From: Michael van Tellingen <michael@mvantellingen.nl>
+Date: Sun, 30 Apr 2017 10:15:08 +0200
+Subject: [PATCH 7/8] Fix widgets.ImageInput for Django 1.11
+
+The FileInput.format_value returns None instead of the passed value
+in Django 1.11. Remove the usage of format_value since it was a noop
+before Django 1.11 anyway
+
+Fixes #2334
+---
+ src/oscar/forms/widgets.py | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/oscar/forms/widgets.py b/src/oscar/forms/widgets.py
+index 6f0f5e7..2a03919 100644
+--- a/src/oscar/forms/widgets.py
++++ b/src/oscar/forms/widgets.py
+@@ -48,8 +48,7 @@ class ImageInput(FileInput):
+ # can't display images that aren't stored
+ image_url = ''
+ else:
+- image_url = final_attrs['value'] = force_text(
+- self._format_value(value))
++ image_url = final_attrs['value'] = value
+
+ return render_to_string(self.template_name, {
+ 'input_attrs': flatatt(final_attrs),
+--
+2.9.4
+