Permalink
Browse files

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
  • Loading branch information...
1 parent 44ca5f4 commit 1a2005dfed5234f33c44de0e89b53d042c714d94 @malcolmt malcolmt committed Jun 30, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/db/models/base.py
View
@@ -457,7 +457,7 @@ def _get_next_or_previous_in_order(self, is_next):
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):

0 comments on commit 1a2005d

Please sign in to comment.