mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-23 22:49:50 +03:00
Fix for null HyperlinkedRelatedField in POST/PUT
This commit is contained in:
parent
afa75db65d
commit
b95f505c74
|
@ -574,6 +574,9 @@ class HyperlinkedRelatedField(RelatedField):
|
|||
if self.queryset is None:
|
||||
raise Exception('Writable related fields must include a `queryset` argument')
|
||||
|
||||
if value is None:
|
||||
return None
|
||||
|
||||
if value.startswith('http:') or value.startswith('https:'):
|
||||
# If needed convert absolute URLs to relative path
|
||||
value = urlparse(value).path
|
||||
|
|
Loading…
Reference in New Issue
Block a user