From 010db598f63758fa5fa4a7d9238092d299853a00 Mon Sep 17 00:00:00 2001 From: Aron Podrigal Date: Mon, 23 Mar 2015 22:52:47 -0400 Subject: [PATCH] Not all File Objects have a .url attribute --- rest_framework/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/fields.py b/rest_framework/fields.py index a80862e8c8..085706c468 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1106,7 +1106,7 @@ def to_internal_value(self, data): return data def to_representation(self, value): - if self.use_url: + if self.use_url and hasattr(value, 'url'): if not value: return None url = value.url pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy