Django

Code

Changeset 4259

Show
Ignore:
Timestamp:
12/29/06 13:42:56 (2 years ago)
Author:
adrian
Message:

Fixed #3204 -- Changed FormPreview? to use RequestContext?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/formtools/preview.py

    r4164 r4259  
    9292        "Displays the form" 
    9393        f = self.form(auto_id=AUTO_ID) 
    94         return render_to_response(self.form_template, {'form': f, 'stage_field': self.unused_name('stage'), 'state': self.state}) 
     94        return render_to_response(self.form_template, 
     95            {'form': f, 'stage_field': self.unused_name('stage'), 'state': self.state}, 
     96            context_instance=RequestContext(request)) 
    9597 
    9698    def preview_post(self, request): 
     
    101103            context['hash_field'] = self.unused_name('hash') 
    102104            context['hash_value'] = self.security_hash(request, f) 
    103             return render_to_response(self.preview_template, context
     105            return render_to_response(self.preview_template, context, context_instance=RequestContext(request)
    104106        else: 
    105             return render_to_response(self.form_template, context
     107            return render_to_response(self.form_template, context, context_instance=RequestContext(request)
    106108 
    107109    def post_post(self, request): 
     
    113115            return self.done(request, f.clean_data) 
    114116        else: 
    115             return render_to_response(self.form_template, {'form': f, 'stage_field': self.unused_name('stage'), 'state': self.state}) 
     117            return render_to_response(self.form_template, 
     118                {'form': f, 'stage_field': self.unused_name('stage'), 'state': self.state}, 
     119                context_instance=RequestContext(request)) 
    116120 
    117121    # METHODS SUBCLASSES MIGHT OVERRIDE IF APPROPRIATE ########################