Browse Source

Only associate demo check if it doesn't have an owner already.

pull/7/head
Pēteris Caune 9 years ago
parent
commit
9e2edeeceb
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      hc/accounts/views.py

+ 6
- 2
hc/accounts/views.py View File

@ -24,8 +24,12 @@ def _make_user(email):
def _associate_demo_check(request, user): def _associate_demo_check(request, user):
if "welcome_code" in request.session: if "welcome_code" in request.session:
check = Check.objects.get(code=request.session["welcome_code"]) check = Check.objects.get(code=request.session["welcome_code"])
check.user = user
check.save()
# Only associate demo check if it doesn't have an owner already.
if check.user is None:
check.user = user
check.save()
del request.session["welcome_code"]
def _send_login_link(user): def _send_login_link(user):


Loading…
Cancel
Save