Reformatted datacenterlight/tasks.py

This commit is contained in:
PCoder 2017-09-23 13:09:14 +05:30
parent b17af3bb09
commit 0bc2b22f62

View file

@ -52,7 +52,8 @@ def create_vm_task(self, vm_template_id, user, specs, template,
stripe_customer_id, billing_address_data, stripe_customer_id, billing_address_data,
billing_address_id, billing_address_id,
charge, cc_details): charge, cc_details):
logger.debug("Running create_vm_task on {}".format(current_task.request.hostname)) logger.debug(
"Running create_vm_task on {}".format(current_task.request.hostname))
vm_id = None vm_id = None
try: try:
final_price = specs.get('price') final_price = specs.get('price')
@ -144,7 +145,8 @@ def create_vm_task(self, vm_template_id, user, specs, template,
if 'pass' in user: if 'pass' in user:
lang = 'en-us' lang = 'en-us'
if user.get('language') is not None: if user.get('language') is not None:
logger.debug("Language is set to {}".format(user.get('language'))) logger.debug(
"Language is set to {}".format(user.get('language')))
lang = user.get('language') lang = user.get('language')
translation.activate(lang) translation.activate(lang)
# Send notification to the user as soon as VM has been booked # Send notification to the user as soon as VM has been booked