Django

Code

Ticket #7460: cache_replace_space_with_underscore.diff

File cache_replace_space_with_underscore.diff, 0.6 kB (added by trbs, 2 years ago)
  • a/django/templatetags/cache.py

    old new  
    1616        # Build a unicode key for this fragment and all vary-on's. 
    1717        cache_key = u':'.join([self.fragment_name] + \ 
    1818            [force_unicode(resolve_variable(var, context)) for var in self.vary_on]) 
     19        cache_key = cache_key.replace(" ", "_") 
    1920        value = cache.get(cache_key) 
    2021        if value is None: 
    2122            value = self.nodelist.render(context)