From 5cbe17ab8c2b98f3b9fb0e941a6c9015c89f2a40 Mon Sep 17 00:00:00 2001 From: alice Date: Mon, 26 Jul 2021 00:13:25 +0200 Subject: [PATCH] ensures User.vpnuser is created on signup --- lambdainst/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lambdainst/views.py b/lambdainst/views.py index 3ae1b1f..9bf0ab1 100644 --- a/lambdainst/views.py +++ b/lambdainst/views.py @@ -98,6 +98,12 @@ def signup(request): ) user.save() + try: + user.vpnuser + except VPNUser.DoesNotExist: + user.vpnuser = VPNUser.objects.create(user=user) + user.vpnuser.save() + try: user.vpnuser.referrer = User.objects.get(id=request.session.get("referrer")) except User.DoesNotExist: