Skip to content

Commit

Permalink
fixed double-placeholder-toolbar-bug (thanks to fr4gd13b/oversize for…
Browse files Browse the repository at this point in the history
… reporting this issue)
  • Loading branch information
Jonas Obrist committed Aug 13, 2010
1 parent 34f28a5 commit 43a4c81
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions cms/templatetags/cms_tags.py
Expand Up @@ -191,20 +191,7 @@ def render(self, context):
if self.nodelist_or:
content = self.nodelist_or.render(context)
return content
elif placeholder and self.edit_mode(placeholder, context):
return render_placeholder_toolbar(placeholder, context, content)
return content

def edit_mode(self, placeholder, context):
from cms.utils.placeholder import get_page_from_placeholder_if_exists
request = context['request']
page = get_page_from_placeholder_if_exists(placeholder)
if ("edit" in request.GET or request.session.get("cms_edit", False)) and \
'cms.middleware.toolbar.ToolbarMiddleware' in settings.MIDDLEWARE_CLASSES and \
request.user.is_staff and request.user.is_authenticated() and \
(not page or page.has_change_permission(request)):
return True
return False

@staticmethod
def _get_placeholder(current_page, page, context, name):
Expand Down

0 comments on commit 43a4c81

Please sign in to comment.