From cc78aef74876049a4548398133bad64e405351de Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Wed, 2 Apr 2014 17:11:14 +0100 Subject: [PATCH] Remove redundant parameters from wagtailuserbar tag; trigger a DeprecationWarning if people are still passing a css path --- wagtail/wagtailadmin/templatetags/wagtailuserbar.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wagtail/wagtailadmin/templatetags/wagtailuserbar.py b/wagtail/wagtailadmin/templatetags/wagtailuserbar.py index aeb300eed9..5c9ef5ee94 100644 --- a/wagtail/wagtailadmin/templatetags/wagtailuserbar.py +++ b/wagtail/wagtailadmin/templatetags/wagtailuserbar.py @@ -1,11 +1,19 @@ +import warnings + from django import template + from wagtail.wagtailadmin.views import userbar from wagtail.wagtailcore.models import Page register = template.Library() @register.simple_tag(takes_context=True) -def wagtailuserbar(context, current_page=None, items=None): +def wagtailuserbar(context, css_path=None): + if css_path is not None: + warnings.warn( + "Passing a CSS path to the wagtailuserbar tag is no longer required; use {% wagtailuserbar %} instead", + DeprecationWarning + ) # Find request object request = context['request']