Add *args, **kwargs to ModalBackdropMixin's init method

Before this change ModalBackdropMixin called super(...).__init__()
without arguments. This imposed restrictions on what classes this
mixin could have been mixed into, i.e. only classes, that do not accept
any parameters.
This proved to be a problem for murano-dashboard, since it uses this
mixin (indirectly through ModalFormMixin) and mixes it into a class,
that accepts parameters to it's init method.
This change allows to use ModalBackdropMixin with classes that have
init methods with parameters.

Change-Id: I6155476738021b784ef7e643c968f1d784b15906
Closes-Bug: #1582816
(cherry picked from commit bb1547c8ab)
This commit is contained in:
Kirill Zaitsev 2016-05-17 19:59:40 +03:00 committed by Rob Cresswell
parent 68d22660bb
commit 94d28df201
1 changed files with 2 additions and 2 deletions

View File

@ -43,8 +43,8 @@ class ModalBackdropMixin(object):
"""
modal_backdrop = 'static'
def __init__(self):
super(ModalBackdropMixin, self).__init__()
def __init__(self, *args, **kwargs):
super(ModalBackdropMixin, self).__init__(*args, **kwargs)
config = getattr(settings, 'HORIZON_CONFIG', {})
if 'modal_backdrop' in config:
self.modal_backdrop = config['modal_backdrop']