summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-06-30 07:17:18 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-06-30 07:17:18 +0000
commit1a2005dfed5234f33c44de0e89b53d042c714d94 (patch)
tree9dcfb81e9b35c2a93d10df5df80247b5dcd5d62e
parent44ca5f46c9ca1a6eeeaa4f6fd30d0a3ea7a719bf (diff)
Fixed #7156 -- Normalise file paths before returning them in models.
This avoids problems with a database that was created on Unix being used on Windows and giving interesting results. Patch from fcaprioli@alice.it. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7795 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/models/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py
index 70420300e4..659c67c0d3 100644
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -457,7 +457,7 @@ class Model(object):
def _get_FIELD_filename(self, field):
if getattr(self, field.attname): # value is not blank
- return os.path.join(settings.MEDIA_ROOT, getattr(self, field.attname))
+ return os.path.normpath(os.path.join(settings.MEDIA_ROOT, getattr(self, field.attname)))
return ''
def _get_FIELD_url(self, field):