Use `get_primary_key_fields()` instead of `primary_key`, because the former knows how to handle composite keys
Nice, thanks! I also merged another fix that should also take care of any other instances of the issue.
There is already a method `get_primary_key_fields()` which does just what is expected: return the list of all primary key fields, also handling CompositeKeys just right.

There are probably some more instances throughout the code, where using that method instead of `primary_key` would be advisable.

This should fix isse #1219.