Commit 1a2005df authored by Malcolm Tredinnick's avatar Malcolm Tredinnick
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
parent 44ca5f46
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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):