mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Fixed base_url duplication in FileField.use_url
Django already joins base_url when constructing FileField.url
This commit is contained in:
parent
4e001dbb7a
commit
ea76dc18b6
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user