﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
3018	[patch] FileField does not allow modifications with upload_to set	ido	Adrian Holovaty	"When you have FileField with the upload_to option; second time uploaded filename is always considered invalid.
Ie. you can create one instance, but you can't go back and edit this one and save. You always get:

    Enter a valid filename.

This is very similar to ticket #2923

The issue is in: djang/db/models/fields/__init__.py:def isWithinMediaRoot

this validator check explicitly if the uploaded file is in settings.MEDIA_ROOT
while part of the point of upload_to is that you can specify another directory.

i changed ""settings.MEDIA_ROOT"" to ""self.upload_to or settings.MEDIA_ROOT""
to ensure that if upload_to is set, that location is used.
"	defect	closed	contrib.admin	dev	normal	worksforme			Unreviewed	1	0	0	0	0	0
