Commits

Matthew Schinckel committed 9bbf7f9

Correctly strip out garbage added in by mod_python

Comments (0)

Files changed (1)

menus/templatetags/menu_item.py

         
         if 'request' not in context:
             raise template.TemplateSyntaxError("menu_item tag requires 'request' in context")
-
+        
+        request = context['request']
+        
         if 'page_url' in context:
             page_url = context['page_url']
         elif 'flatpage' in context:
             page_url = context['flatpage'].url
         else:
-            page_url = context['request'].path
+            page_url = request.path
         
-        user = context['request'].user
+        user = request.user
+
+        local['url'] = local['url'].replace(request.META.get('SCRIPT_NAME',''), '')
+            
         view = resolve(local['url']).func
         can_view = all([test(user) for test in get_tests(view)])