Skip to content

TemplateSyntaxError — Invalid filter: 'length_is' #1

@Ekubbo

Description

@Ekubbo

Description

When opening the Django admin page /admin/auth/user/add/, a TemplateSyntaxError is raised:

Steps to Reproduce

  1. Run the development server
  2. Go to http://127.0.0.1:8000/admin/auth/user/add/
  3. Observe the error

Actual Behavior

A TemplateSyntaxError occurs due to usage of the length_is filter, which is no longer available in Django 5.x.

Environment

  • Django version: 5.2.7
  • Python version: 3.11.0
  • OS: macOS
  • Browser: any

Suggested Fix

Remove the |length_is filter from affected templates (e.g. volt/templates/admin/...html)
and replace it with a standard check, for example:

{% if line.fields|length == 1 %}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions