Merge pull request #2038 from NextHub/master

Fixed base_url duplication in FileField.use_url
This commit is contained in:
Tom Christie 2014-11-06 17:37:52 +00:00
commit a40b805963

View File

@ -1007,7 +1007,7 @@ class FileField(Field):
if self.use_url: if self.use_url:
if not value: if not value:
return None return None
url = settings.MEDIA_URL + value.url url = value.url
request = self.context.get('request', None) request = self.context.get('request', None)
if request is not None: if request is not None:
return request.build_absolute_uri(url) return request.build_absolute_uri(url)