Skip to content

Attempting to render one of the django.html inputs without backing it with a form field errors #59

Description

@kezabelle

Given:
{% widget "form_alias:TextInput" id="lol" raw_value="lol2" %}
An exception is raised:
AttributeError: 'str' object has no attribute 'items'

because {{ widget.attrs|flatattrs }} receives '' (or TEMPLATE_STRING_IF_INVALID maybe? dunno) due to not having a Widget instance in the context.

Probably the fix is to wrap the widget attrs output in an IfNode?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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