Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

snippet_detail.html #6

Closed
rjharris08 opened this Issue · 6 comments

2 participants

@rjharris08

Django 1.2.4 found errors in snippet_detail.html. Two occurences of request.user in snippet_detail.html had to be replaced with user.

{% if object|is_bookmarked:request.user %}

{% with object|rating_score:request.user as rating_score %}

had to be changed to

{% if object|is_bookmarked:user %}

{% with object|rating_score:user as rating_score %}

@coleifer
Collaborator

Are you running with the request context processor?

@rjharris08

Hmm...well, I don't see it in my project settings.py. Isn't it on by default?

@coleifer
Collaborator

you can try running:

from django.conf import settings
settings.TEMPLATE_CONTEXT_PROCESSORS
@rjharris08

Here's what I get. Is one of these the request context processor? If not, how would I add it?

>>> settings.TEMPLATE_CONTEXT_PROCESSORS ('django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.contrib.messages.context_processors.messages')

@coleifer
Collaborator

'django.core.context_processors.request'

@rjharris08

added the following to the project's settings.py

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.debug', 
    'django.core.context_processors.i18n', 
    'django.core.context_processors.media',
    'django.contrib.messages.context_processors.messages',
    'django.core.context_processors.request'
)

It now works as originally written! YTG

This issue was closed.
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.