Commit 4f0ef1aa by benjaoming

pull #139 - form data from args or kwargs

parent 159025bc
......@@ -120,11 +120,13 @@ class EditForm(forms.Form, SpamProtectionMixin):
data = None
if len(args) > 0:
data = args[0]
if not data:
args = args[1:]
if data is None:
data = kwargs.get('data', None)
if data:
self.presumed_revision = data.get('current_revision', None)
if not str(self.presumed_revision) == str(self.initial_revision.id):
print "IT"
newdata = {}
for k,v in data.items():
newdata[k] = v
......@@ -133,6 +135,9 @@ class EditForm(forms.Form, SpamProtectionMixin):
data.get('content', ""))
newdata['title'] = current_revision.title
kwargs['data'] = newdata
else:
# Always pass as kwarg
kwargs['data'] = data
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