Skip to content
Snippets Groups Projects
Commit 2706cc44 authored by Jean-Baptiste's avatar Jean-Baptiste
Browse files

bugfix: fieldname can be None

parent 77e5f8fe
No related branches found
No related tags found
1 merge request!42Resolve "500 error on sib-form POST : KeyError at /api/action-groups/ 'pk'"
Pipeline #816 passed with stage
in 1 minute and 21 seconds
......@@ -364,7 +364,7 @@ class LDPSerializer(HyperlinkedModelSerializer):
info = model_meta.get_field_info(ModelClass)
many_to_many = {}
for field_name, relation_info in info.relations.items():
if relation_info.to_many and relation_info.reverse and not (field_name in validated_data):
if relation_info.to_many and relation_info.reverse and not (field_name in validated_data) and not field_name is None:
rel = getattr(instance._meta.model, field_name).rel
if rel.name in validated_data:
related = validated_data[rel.name]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment