dj2: many-to-many assignment (#37317)
RemovedInDjango20Warning: Direct assignment to the forward side of a many-to-many set is deprecated due to the implicit save() that happens. Use groups.set() instead.
This commit is contained in:
parent
52ff4d1bb4
commit
fe29b96a4b
|
@ -38,7 +38,7 @@ def manager_user():
|
|||
group, created = Group.objects.get_or_create(name='Managers')
|
||||
if created:
|
||||
group.save()
|
||||
user.groups = [group]
|
||||
user.groups.set([group])
|
||||
return user
|
||||
|
||||
@pytest.fixture
|
||||
|
|
Loading…
Reference in New Issue