Skip to content
Browse files

Trivial changes:

- Removed unused imports
- Renamed fugly variables (come on, one letter?)
- Most important: I gave the id parameter to the modify() function a real explicit name that DOES NOT CLASH WITH A BUILTIN!
  • Loading branch information...
1 parent 8123962 commit 16412182c79b9d9b3808d90d448f038ce0126677 @chrisglass chrisglass committed Nov 26, 2010
Showing with 5 additions and 6 deletions.
  1. +4 −5 cms/menu.py
  2. +1 −1 menus/base.py
View
9 cms/menu.py
@@ -5,7 +5,6 @@
from django.conf import settings
from django.contrib.sites.models import Site
from cms.utils.i18n import get_fallback_languages
-from cms.exceptions import NoHomeFound
from cms.apphook_pool import apphook_pool
from cms.models.titlemodels import Title
@@ -41,15 +40,15 @@ def page_to_node(page, home, cut):
attr['redirect_url'] = page.get_redirect() # save redirect URL is any
if extenders:
attr['navigation_extenders'] = extenders
- n = NavigationNode(
+ ret_node = NavigationNode(
page.get_menu_title(),
page.get_absolute_url(),
page.pk,
parent_id,
attr=attr,
visible=page.in_navigation,
)
- return n
+ return ret_node
class CMSMenu(Menu):
@@ -110,7 +109,7 @@ def get_nodes(self, request):
menu_pool.register_menu(CMSMenu)
class NavExtender(Modifier):
- def modify(self, request, nodes, namespace, id, post_cut, breadcrumb):
+ def modify(self, request, nodes, namespace, root_id, post_cut, breadcrumb):
if post_cut:
return nodes
exts = []
@@ -158,7 +157,7 @@ def modify(self, request, nodes, namespace, id, post_cut, breadcrumb):
class SoftRootCutter(Modifier):
- def modify(self, request, nodes, namespace, id, post_cut, breadcrumb):
+ def modify(self, request, nodes, namespace, root_id, post_cut, breadcrumb):
if post_cut or not settings.CMS_SOFTROOT:
return nodes
selected = None
View
2 menus/base.py
@@ -17,7 +17,7 @@ def get_nodes(self, request):
class Modifier(object):
- def modify(self, request, nodes, namespace, id, post_cut, breadcrumb):
+ def modify(self, request, nodes, namespace, root_id, post_cut, breadcrumb):
pass
class NavigationNode(object):

0 comments on commit 1641218

Please sign in to comment.
Something went wrong with that request. Please try again.