Opened 5 years ago

Closed 5 years ago

#20837 closed Bug (invalid)

comments app template tags don't resolve context variables

Reported by: James Addison Owned by: nobody
Component: contrib.comments Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


From the django comments app docs, you're able to specify the app.model and object_pk if you don't have an object in the template context, like this:

{% get_comment_list for object_pk as comment_list %}

However, I have a scenario where I want to pass in the app.model value in a context variable. eg. say I have a variable called object_content_type containing '', this errors out:

{% get_comment_list for object_content_type object_pk as comment_list %}

as does this:

{% get_comment_list for '' object_pk as comment_list %}

Error info:

TemplateSyntaxError at /my-comments-page/
Third argument in u'get_comment_list' must be in the format 'app.model'

Near as I can figure it, the comments app template tags don't seem to attempt variable resolution of the token. Shouldn't it?

Change History (3)

comment:1 Changed 5 years ago by James Addison

Just a note: isn't this similar to the url vs url from future issue that required deprecation over 2 or 3 versions?

comment:2 Changed 5 years ago by Collin Anderson

I'm not a core developer, but as far as I can tell, everything you have reported is correct and probably a good idea.

However, the entire comments app is deprecated and has been pulled out to a separate project. I suggest proposing this idea there instead.

More info about the deprecation here:

comment:3 Changed 5 years ago by Tim Graham

Resolution: invalid
Status: newclosed

Correct, bugs for contrib.comments are no longer reported here.

Note: See TracTickets for help on using tickets.
Back to Top