Ticket #15368: 15368-requestcontext.diff

File 15368-requestcontext.diff, 1000 bytes (added by Chris Beaven, 14 years ago)
  • django/template/context.py

    diff --git a/django/template/context.py b/django/template/context.py
    index cf0c929..f670084 100644
    a b class RequestContext(Context):  
    162162    """
    163163    def __init__(self, request, dict=None, processors=None, current_app=None, use_l10n=None):
    164164        Context.__init__(self, dict, current_app=current_app, use_l10n=use_l10n)
    165         if processors is None:
    166             processors = ()
    167         else:
    168             processors = tuple(processors)
    169         for processor in get_standard_processors() + processors:
    170             self.update(processor(request))
     165        if request is not None:
     166            if processors is None:
     167                processors = ()
     168            else:
     169                processors = tuple(processors)
     170            for processor in get_standard_processors() + processors:
     171                self.update(processor(request))
    171172
    172173    def _new(self):
    173174        return self.__class__(request=HttpRequest(),
Back to Top