Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Form is rendered in Request Vars panel #367

sneawo opened this Issue · 6 comments

3 participants

Andrey Zhukov Lucas Inojosa Aymeric Augustin
Andrey Zhukov

If form is passed through urls kwargs, it's rendered.

        kwargs={"template_name": "friends_app/invite_postcard.html", 
                             "form_class": InviteForm},

Screen Shot 2013-04-02 at 10 57 47

Lucas Inojosa

Could reproduce the bug. I'll try to fix it.

Lucas Inojosa

Here lies the problem:

{% for k, v in view_kwargs.items %}
    {{ k }}={{ v }}{% if not forloop.last %}, {% endif %}
{% endfor %}

It shows the kwargs in the format "key=value". However, in the class_form attribute, the {{ v }} is the form, thus it renders it normally.

Lucas Inojosa

What do you guys think about this solution I've written?
I'm converting all the args to its string representation before passing to the view for them to be safe when displaying.

Lucas Inojosa

Bringing here the discussion from my commit.

@sneawo commented on b3df0e4 (23 days ago)
Looks good for me. Why not use str(arg)?

@lucasicf commented on b3df0e4 (5 minutes ago)
To avoid possible problems with unicode strings, but I tested some code and saw that it does not make difference.

'%s'%object calls __str__ and u'%s'%object calls __unicode__. There's no risk of getting an unicode string and trying to convert it to 8-bit strings.

I'll change it and send a pull request.

Aymeric Augustin

#418 describes a more holistic fix for this category of issues.

Aymeric Augustin

This was fixed in 982f341.

Aymeric Augustin aaugustin closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.