mirror of
https://github.com/zulip/zulip.git
synced 2025-11-23 07:52:35 +00:00
django-2.0: Don't assign directly to Many-to-Many field.
The old pattern of setting the value and then using .save() here has been deprecated. set() also saves the record.
This commit is contained in:
@@ -892,8 +892,7 @@ class GoogleSubdomainLoginTest(GoogleOAuthTest):
|
||||
# Now confirm an invitation link works
|
||||
referrer = self.example_user("hamlet")
|
||||
multiuse_obj = MultiuseInvite.objects.create(realm=realm, referred_by=referrer)
|
||||
multiuse_obj.streams = streams
|
||||
multiuse_obj.save()
|
||||
multiuse_obj.streams.set(streams)
|
||||
invite_link = create_confirmation_link(multiuse_obj, realm.host,
|
||||
Confirmation.MULTIUSE_INVITE)
|
||||
|
||||
|
||||
@@ -1024,8 +1024,7 @@ class MultiuseInviteTest(ZulipTestCase):
|
||||
invite.save()
|
||||
|
||||
if streams is not None:
|
||||
invite.streams = streams
|
||||
invite.save()
|
||||
invite.streams.set(streams)
|
||||
|
||||
if date_sent is None:
|
||||
date_sent = timezone_now()
|
||||
|
||||
Reference in New Issue
Block a user