]> review.fuel-infra Code Review - openstack-build/horizon-build.git/commitdiff
Add django-1.10-fixes-get-form-uses-kwargs.patch
authorThomas Goirand <thomas@goirand.fr>
Wed, 20 Jul 2016 16:51:01 +0000 (16:51 +0000)
committerThomas Goirand <thomas@goirand.fr>
Wed, 20 Jul 2016 16:51:01 +0000 (16:51 +0000)
Rewritten-From: 1a6558a8c0d3c6cb167fbfa67d66f4420b5513aa

xenial/debian/changelog
xenial/debian/patches/django-1.10-fixes-get-form-uses-kwargs.patch [new file with mode: 0644]
xenial/debian/patches/series

index 2037c75aa5e413866123c5b9349f575daee7c1f2..0d8d4c02062841da4ae150ade52fdf76c3fcb84b 100644 (file)
@@ -4,6 +4,7 @@ horizon (3:10.0.0~b2-2) UNRELEASED; urgency=medium
     - django-1.10-django.conf.urls.patterns-removed.patch
     - django-1.10-define-TEMPLATES.patch
     - django-1.10-fix-wrong-django.conf.urls.url-call.patch
+    - django-1.10-fixes-get-form-uses-kwargs.patch
 
  -- Thomas Goirand <zigo@debian.org>  Wed, 20 Jul 2016 10:49:45 +0200
 
diff --git a/xenial/debian/patches/django-1.10-fixes-get-form-uses-kwargs.patch b/xenial/debian/patches/django-1.10-fixes-get-form-uses-kwargs.patch
new file mode 100644 (file)
index 0000000..f0c0ccc
--- /dev/null
@@ -0,0 +1,20 @@
+Description: Fixes get_form() uses kwargs
+ In Django 1.10, get_from() needs to use kwargs instead of a normal param.
+Author: Thomas Goirand <zigo@debian.org>
+Forwarded: no
+Last-Update: 2016-07-20
+
+--- horizon-10.0.0~b2.orig/horizon/forms/views.py
++++ horizon-10.0.0~b2/horizon/forms/views.py
+@@ -165,8 +165,10 @@ class ModalFormView(ModalFormMixin, view
+         """
+         return obj.name
+-    def get_form(self, form_class):
++    def get_form(self, form_class=None):
+         """Returns an instance of the form to be used in this view."""
++        if form_class is None:
++            form_class = self.get_form_class()
+         return form_class(self.request, **self.get_form_kwargs())
+     def form_invalid(self, form):
index 9230276ee9de0085b04f62bf68e1a84d42479640..2bfcd3efec154b80912a9a344014396191045824 100644 (file)
@@ -5,3 +5,4 @@ BaseCommand.option_list-is-gone-from-django1.10.patch
 django-1.10-django.conf.urls.patterns-removed.patch
 django-1.10-fix-wrong-django.conf.urls.url-call.patch
 django-1.10-define-TEMPLATES.patch
+django-1.10-fixes-get-form-uses-kwargs.patch