citusdata / citusdata/django-multitenant
`wrap_many_related_manager_add` tries to update `through_defaults`, assuming it is a dict. It is None by default
- Dominant language
- Python
- Stars
- 823
- Forks
- 126
- PR merge metrics
- No merged PRs in 30d
Description
Python 3.10.6
Django 4.0.9
django-multitenant 3.2
```python
def wrap_many_related_manager_add(many_related_manager_add):
...
def add(self, *objs, through_defaults=None):
...
if hasattr(self.through, "tenant_field") and get_current_tenant():
through_defaults[
get_tenant_column(self.through)
] = get_current_tenant_value()
```
```
File ".../django/db/models/fields/related_descriptors.py", line 1130, in set
self.add(*new_objs, through_defaults=through_defaults)
File ".../django_multitenant/mixins.py", line 42, in add
through_defaults[
TypeError: 'NoneType' object does not support item assignment
```
Contributor guide
Assessment
This issue has not been assessed yet.