From a4d86a7fb09e19779ea87ef0c29d0a85abade260 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Tue, 7 Nov 2006 02:25:49 +0000 Subject: [PATCH] Fixed #2923: FileFields can now be modified on windows. Thanks, radek. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4036 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/fields/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 2ec5e8c7c7..bc1eaf0a6a 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -585,7 +585,7 @@ class FileField(Field): # If the raw path is passed in, validate it's under the MEDIA_ROOT. def isWithinMediaRoot(field_data, all_data): f = os.path.abspath(os.path.join(settings.MEDIA_ROOT, field_data)) - if not f.startswith(os.path.normpath(settings.MEDIA_ROOT)): + if not f.startswith(os.path.abspath(os.path.normpath(settings.MEDIA_ROOT))): raise validators.ValidationError, _("Enter a valid filename.") field_list[1].validator_list.append(isWithinMediaRoot) return field_list