Pass the seed to _constructResponse
authorSverre Rabbelier <srabbelier@gmail.com>
Tue, 24 Feb 2009 23:11:15 +0000
changeset 1497 1387f0d2cf45
parent 1496 da531df1d92e
child 1498 00293057b009
Pass the seed to _constructResponse This way _editContext has access to it; this will be used by the commenting system. Patch by: Sverre Rabbelier
app/soc/views/models/base.py
--- a/app/soc/views/models/base.py	Tue Feb 24 23:10:50 2009 +0000
+++ b/app/soc/views/models/base.py	Tue Feb 24 23:11:15 2009 +0000
@@ -448,6 +448,9 @@
       self._editSeed(request, seed)
 
       if seed:
+        # pass the seed through the  context to _constructResponse
+        # it will be popped before dispatching to Django
+        context['seed'] = seed
         form = params['create_form'](initial=seed)
       else:
         form = params['create_form']()
@@ -788,6 +791,10 @@
         template = params['create_template']
 
     self._editContext(request, context)
+
+    # remove the seed from the context before dispatching to Django
+    context.pop('seed', None)
+
     return helper.responses.respond(request, template, context)
 
   def getParams(self):