[Django] #22706: Debug error is not working fine when filepath is bad

3 views
Skip to first unread message

Django

unread,
May 26, 2014, 1:02:14 PM5/26/14
to django-...@googlegroups.com
#22706: Debug error is not working fine when filepath is bad
--------------------------------------+--------------------
Reporter: gox21mx@… | Owner: nobody
Type: Bug | Status: new
Component: File uploads/storage | Version: 1.6
Severity: Normal | Keywords: Debug
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
Write an upload_to_function that overrides the upload_to on models. Use
MEDIA_ROOT/modelname/file.ext for that, on settings.py remove tha last
slash (/) from MEDIA_ROOT.

Write a model that have a field that have upload_to=upload_to_function

It will cause that the complete url seems like:

/MEDIA_ROOTmodelname/file.ext #clearly you see there is a slash (/)
missing.

Go to the admin and try to add a new object for the model that calls to
upload_to_function you created

on django 1.3 you'll got:

SuspiciousOperation at /admin/app/model/add/
Attemped access to '/BASE_PATH/mediafolderfile.ext' denied

on django 1.6.5 you'll got
Bad Request (400)

Definitively it is impossible to figure out what is causing the error on
django 1.6.5

--
Ticket URL: <https://code.djangoproject.com/ticket/22706>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 26, 2014, 1:52:46 PM5/26/14
to django-...@googlegroups.com
#22706: Debug error is not working fine when filepath is bad
-------------------------------------+-------------------------------------
Reporter: gox21mx@… | Owner: nobody
Type: Bug | Status: closed
Component: File | Version: 1.6
uploads/storage | Resolution: duplicate
Severity: Normal | Triage Stage:
Keywords: Debug | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* status: new => closed
* needs_better_patch: => 0
* resolution: => duplicate
* needs_tests: => 0
* needs_docs: => 0


Comment:

Duplicate of #21668. I've made a note of your experience there, thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/22706#comment:1>

Reply all
Reply to author
Forward
0 new messages