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')
|
||||||
|
try:
|
||||||
custom_user = CustomUser.objects.get(email=user.get('email'))
|
custom_user = CustomUser.objects.get(email=user.get('email'))
|
||||||
if custom_user is None:
|
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