37 | | The `contact.entities.add(from_entity)` is in a loop, which I'm not changing to pass an array to add all at once instead. Hopefully that could fix the problem, maybe some cache in the `entities` manager is not letting `_add_items()` to properly get the already used primary keys. |
| 37 | |
| 38 | The `contact.entities.add(from_entity)` is in a loop, and entities is a `ManyToManyField` (`entities = models.ManyToManyField(User)` in `SocialContact`): |
| 39 | {{{ |
| 40 | for contact in SocialContact.objects.filter(id__in=contact_ids): |
| 41 | contact.entities.add(from_entity) |
| 42 | }}} |