Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some minor cleanups

  • Loading branch information...
commit ce90ac150827cc1673c071e874a337c347f01359 1 parent 421961d
@ojii ojii authored
Showing with 4 additions and 4 deletions.
  1. +1 −1  cms/api.py
  2. +3 −3 cms/templatetags/cms_admin.py
View
2  cms/api.py
@@ -269,7 +269,7 @@ def add_plugin(placeholder, plugin_type, language, position='last-child',
max_pos = CMSPlugin.objects.filter(language=language,
- placeholder=placeholder).aggregate(Max('position')).values()[0] or 0
+ placeholder=placeholder).aggregate(Max('position'))['position__max'] or 0
plugin_base = CMSPlugin(
plugin_type=plugin_type,
View
6 cms/templatetags/cms_admin.py
@@ -81,8 +81,8 @@ def boolean_icon(value):
@register.filter
def is_restricted(page, request):
if settings.CMS_PERMISSION:
- all_perms = get_any_page_view_permissions(request, page)
- icon = boolean_icon(all_perms.exists())
+ all_perms = list(get_any_page_view_permissions(request, page))
+ icon = boolean_icon(bool(all_perms))
return mark_safe(
ugettext('<span title="Restrictions: %(title)s">%(icon)s</span>') % {
'title': u', '.join((perm.get_grant_on_display() for perm in all_perms)) or None,
@@ -178,4 +178,4 @@ def get_context(self, context):
def in_filtered(seq1, seq2):
return [x for x in seq1 if x in seq2]
-in_filtered = register.filter('in_filtered', in_filtered)
+in_filtered = register.filter('in_filtered', in_filtered)
Please sign in to comment.
Something went wrong with that request. Please try again.