#7553 closed (fixed)
return None in sites.py doesn't work with decorators
Reported by: | Michael Newman | Owned by: | Brian Rosner |
---|---|---|---|
Component: | contrib.admin | Version: | newforms-admin |
Severity: | Keywords: | admin nfa-blocker | |
Cc: | newmaniese@…, cmawebsite@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Simply, adding the cache to the login view in the new admin broke the way it handled persistent data. http://buildbot.djangoproject.com/newforms-admin%202.4%20sqlite/builds/237/step-test/0
Attachments (4)
Change History (14)
by , 16 years ago
comment:1 by , 16 years ago
milestone: | 1.0 alpha → 1.0 |
---|
According to ticket organization defined in http://code.djangoproject.com/wiki/VersionOneRoadmap#how-you-can-help 1.0 alpha tickets should be just features in the Must have (http://code.djangoproject.com/wiki/VersionOneRoadmap#must-have-features) list.
As bug, it should be fixed before 1.0 milestone.
comment:2 by , 16 years ago
Keywords: | nfa-blocker added |
---|---|
milestone: | 1.0 → 1.0 alpha |
Owner: | changed from | to
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
This is broken functionality since [7737]. It needs to block the merge. Tagging as so and milestone for 1.0 alpha. I will have it fixed shortly.
comment:3 by , 16 years ago
Component: | Contrib apps → Admin interface |
---|
comment:4 by , 16 years ago
I fixed this in [7824] without realising there was a ticket for it. brosner: you should check that my fix is appropriate (the fix in the patch attached to this ticket may be a better option).
by , 16 years ago
Attachment: | 7553-sites-decorators-excpt.diff added |
---|
A proof-of-concept patch using an exception to catch data that may fall through.
by , 16 years ago
Attachment: | 7553-sites-decorators-ref.diff added |
---|
Another way to fix this problem using refactored code, without a try and except. Still not the cleanest.
comment:5 by , 16 years ago
Here are two patches which fix this problem. One is raising an exception from the view, that can be caught when there is Post Data that might be lost and the second reuses the root function with the self.root_url variable that is available to just return the root function. I prefer the later (Catching a manufactured exception is a little ... well...). Simon, your revision fixes the problem, but Brian and I decided that this needs to be fixed in the admin and that the views shouldn't be changed to handle the admin. Also, login is a view function, except that one time when it returns None and it becomes just another function.
comment:6 by , 16 years ago
Cc: | added |
---|
comment:7 by , 16 years ago
Cc: | added |
---|
comment:8 by , 16 years ago
What is the reason for moving delete_test_cookie
and removing the
is_active
check?
by , 16 years ago
Attachment: | 7553-sites-decorators-ref.2.diff added |
---|
Updated based on brosner's comments
comment:9 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Simple patch that uses the request path to get the response from model_page instead