Added CustomUser.DoesNotExist error exception
This commit is contained in:
parent
31c389e72c
commit
5caa79f199
1 changed files with 3 additions and 2 deletions
|
@ -329,8 +329,9 @@ class PaymentOrderView(FormView):
|
||||||
vm_template_id = template.get('id', 1)
|
vm_template_id = template.get('id', 1)
|
||||||
final_price = specs.get('price')
|
final_price = specs.get('price')
|
||||||
token = form.cleaned_data.get('token')
|
token = form.cleaned_data.get('token')
|
||||||
custom_user = CustomUser.objects.get(email=user.get('email'))
|
try:
|
||||||
if custom_user is None:
|
custom_user = CustomUser.objects.get(email=user.get('email'))
|
||||||
|
except CustomUser.DoesNotExist:
|
||||||
password = CustomUser.get_random_password()
|
password = CustomUser.get_random_password()
|
||||||
# Register the user, and do not send emails
|
# Register the user, and do not send emails
|
||||||
CustomUser.register(user.get('name'),
|
CustomUser.register(user.get('name'),
|
||||||
|
|
Loading…
Reference in a new issue