diff --git a/rest_framework/relations.py b/rest_framework/relations.py index 221c72fba..046b0db17 100644 --- a/rest_framework/relations.py +++ b/rest_framework/relations.py @@ -129,8 +129,8 @@ class RelatedField(WritableField): try: # Form data value = data.getlist(field_name) - if value == ['']: - value = [] + if value == [''] or value == []: + raise KeyError except AttributeError: # Non-form data value = data[field_name]