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