Avoid request.user.is_authenticated()
This commit is contained in:
parent
3e95a389bb
commit
ca7481cce0
1 changed files with 33 additions and 39 deletions
|
@ -991,7 +991,6 @@ def do_create_vm(request, user, stripe_api_cus_id, card_details_response,
|
|||
specs, vm_template_id, template):
|
||||
# Create user if the user is not logged in and if he is not already
|
||||
# registered
|
||||
if not request.user.is_authenticated():
|
||||
try:
|
||||
custom_user = CustomUser.objects.get(
|
||||
email=user.get('email'))
|
||||
|
@ -1026,11 +1025,6 @@ def do_create_vm(request, user, stripe_api_cus_id, card_details_response,
|
|||
id=request.session['new_user_hosting_key_id'])
|
||||
user_hosting_key.user = new_user
|
||||
user_hosting_key.save()
|
||||
else:
|
||||
# We assume that if the user is here, his/her StripeCustomer
|
||||
# object already exists
|
||||
stripe_customer_id = request.user.stripecustomer.id
|
||||
custom_user = request.user
|
||||
|
||||
if 'token' in request.session:
|
||||
ucd = UserCardDetail.get_or_create_user_card_detail(
|
||||
|
|
Loading…
Reference in a new issue