Code

Opened 8 years ago

Closed 7 years ago

#2833 closed defect (duplicate)

Request.context tries to access user when there's no session causing traceback

Reported by: Filipe Owned by: nobody
Component: Core (Other) Version: master
Severity: normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: UI/UX:

Description

When using django without a database one will have to explicitly include TEMPLATE_CONTEXT_PROCESSORS in settings.py (as a workaround) in order to remove 'django.core.context_processors.auth'. Otherwise, when having DEBUG=False in settings.py, tracebacks will be displayed whenever HTTP 404s happen, instead of the expected 404.html template.

Please refer to this thread:
http://groups.google.com/group/django-users/browse_frm/thread/2dc05239c27c8a06/b640aa4f26f2d434

Attachments (2)

auth_context_processors_fix.diff (469 bytes) - added by deepak <deep.thukral@…> 7 years ago.
auth_context_processors_fix.2.diff (484 bytes) - added by deepak <deep.thukral@…> 7 years ago.
from toplevel

Download all attachments as: .zip

Change History (6)

comment:1 Changed 8 years ago by mir@…

  • Component changed from Admin interface to Core framework

corrected component

comment:2 Changed 7 years ago by Simon G. <dev@…>

  • Summary changed from Context_processors.auth when there's no session to Request.context tries to access user when there's no session causing traceback
  • Triage Stage changed from Unreviewed to Accepted

Malcolm Tredinnick's explanation:

OK, this is the problem line: RequestContext tries to access "user". The
reason we are using RequestContext is because of ticket #688 (which is
quite a reasonable change). However, we have to conditionally avoid this
user requirement. 

Changed 7 years ago by deepak <deep.thukral@…>

comment:3 Changed 7 years ago by deepak <deep.thukral@…>

  • Has patch set
  • Needs tests set
  • Version set to SVN

If request doesnt have user attribute then it returns empty dictionary.

Changed 7 years ago by deepak <deep.thukral@…>

from toplevel

comment:4 Changed 7 years ago by ubernostrum

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #4049.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.