From eb65fd727e715f6f01ff3f178ae8e7b4b05eaa12 Mon Sep 17 00:00:00 2001 From: adamghill Date: Sun, 30 Jun 2024 18:02:35 -0400 Subject: [PATCH] Update percent formatter. --- django_unicorn/templatetags/unicorn.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django_unicorn/templatetags/unicorn.py b/django_unicorn/templatetags/unicorn.py index 04e9c442..a796079b 100644 --- a/django_unicorn/templatetags/unicorn.py +++ b/django_unicorn/templatetags/unicorn.py @@ -46,7 +46,8 @@ def unicorn(parser, token): contents = token.split_contents() if len(contents) < MINIMUM_ARGUMENT_COUNT: - raise template.TemplateSyntaxError("%r tag requires at least a single argument" % token.contents.split()[0]) + first_arg = token.contents.split()[0] + raise template.TemplateSyntaxError(f"{first_arg} tag requires at least a single argument") component_name = parser.compile_filter(contents[1])