Handle multiple preregistration user objects when choosing streams

(imported from commit 52faa0256a719bed8a8ccc120f8177cce20450e2)
This commit is contained in:
Leo Franchi
2013-04-09 13:10:40 -04:00
parent 1bd5f788b3
commit fb2b3ae21a
2 changed files with 12 additions and 2 deletions

View File

@@ -225,6 +225,12 @@ def accounts_register(request):
user_profile.email,
)
)
# Mark any other PreregistrationUsers that are STATUS_ACTIVE as inactive
# so we can find the PreregistrationUser that we are actually working
# with here
PreregistrationUser.objects.filter(email=email) \
.exclude(id=prereg_user.id) \
.update(status=0)
notify_new_user(user_profile)
queue_json_publish(