Fixed base_url duplication in FileField.use_url

Django already joins base_url when constructing FileField.url
This commit is contained in:
Tymur Maryokhin 2014-11-06 18:20:55 +01:00
parent 4e001dbb7a
commit ea76dc18b6

View File

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