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:
rht
2018-01-31 12:22:07 +05:00
committed by Tim Abbott
parent e4a62aa778
commit 71ff8c370e
6 changed files with 7 additions and 14 deletions

View File

@@ -304,8 +304,7 @@ def prepare_activation_url(email: str, request: HttpRequest,
prereg_user = create_preregistration_user(email, request, realm_creation)
if streams is not None:
prereg_user.streams = streams
prereg_user.save()
prereg_user.streams.set(streams)
confirmation_type = Confirmation.USER_REGISTRATION
if realm_creation: