.
This commit is contained in:
+7
-7
@@ -80,13 +80,13 @@ class RapidForm(ModelForm):
|
|||||||
self.user = kwargs.pop(
|
self.user = kwargs.pop(
|
||||||
"user"
|
"user"
|
||||||
) # To get request.user. Do not use kwargs.pop('user', None) due to potential security hole
|
) # To get request.user. Do not use kwargs.pop('user', None) due to potential security hole
|
||||||
#if kwargs.get("instance"):
|
if kwargs.get("instance"):
|
||||||
# # We get the 'initial' keyword argument or initialize it
|
# We get the 'initial' keyword argument or initialize it
|
||||||
# # as a dict if it didn't exist.
|
# as a dict if it didn't exist.
|
||||||
# initial = kwargs.setdefault("initial", {})
|
initial = kwargs.setdefault("initial", {})
|
||||||
# # The widget for a ModelMultipleChoiceField expects
|
# The widget for a ModelMultipleChoiceField expects
|
||||||
# # a list of primary key for the selected data.
|
# a list of primary key for the selected data.
|
||||||
# initial["exams"] = [t.pk for t in kwargs["instance"].exams.all()]
|
initial["exams"] = [t.pk for t in kwargs["instance"].exams.all()]
|
||||||
|
|
||||||
ModelForm.__init__(self, *args, **kwargs)
|
ModelForm.__init__(self, *args, **kwargs)
|
||||||
super(RapidForm, self).__init__(*args, **kwargs)
|
super(RapidForm, self).__init__(*args, **kwargs)
|
||||||
|
|||||||
Reference in New Issue
Block a user