Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1fd3d6b

Browse files
committedFeb 9, 2024
don't build nested keys for m2m relationships
1 parent 5d4b3d8 commit 1fd3d6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎natural_keys/serializers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def build_natural_key_fields(self):
173173
info = model_meta.get_field_info(self.Meta.model)
174174
fields = OrderedDict()
175175
for field, relation_info in info.relations.items():
176-
if relation_info.reverse:
176+
if relation_info.reverse or relation_info.to_many:
177177
continue
178178
if not self.is_natural_key_model(relation_info.related_model):
179179
continue

0 commit comments

Comments
 (0)
Please sign in to comment.