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:
Lauréline Guérin 2019-10-29 15:11:23 +01:00
parent 52ff4d1bb4
commit fe29b96a4b
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
1 changed files with 1 additions and 1 deletions

View File

@ -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