Commit 09f91ea0 by benjaoming

pull #139 - form data from args or kwargs

parent 159025bc
...@@ -120,7 +120,8 @@ class EditForm(forms.Form, SpamProtectionMixin): ...@@ -120,7 +120,8 @@ class EditForm(forms.Form, SpamProtectionMixin):
data = None data = None
if len(args) > 0: if len(args) > 0:
data = args[0] data = args[0]
if not data: args = args[1:]
if data is None:
data = kwargs.get('data', None) data = kwargs.get('data', None)
if data: if data:
self.presumed_revision = data.get('current_revision', None) self.presumed_revision = data.get('current_revision', None)
...@@ -133,6 +134,9 @@ class EditForm(forms.Form, SpamProtectionMixin): ...@@ -133,6 +134,9 @@ class EditForm(forms.Form, SpamProtectionMixin):
data.get('content', "")) data.get('content', ""))
newdata['title'] = current_revision.title newdata['title'] = current_revision.title
kwargs['data'] = newdata kwargs['data'] = newdata
else:
# Always pass as kwarg
kwargs['data'] = data
kwargs['initial'] = initial kwargs['initial'] = initial
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment