Use username instead of email when creating VM

This commit is contained in:
PCoder 2020-03-05 15:55:44 +05:30
parent e2c86116b2
commit b44a7f98b5
3 changed files with 3 additions and 1 deletions

View file

@ -62,7 +62,7 @@ def create_vm_task(self, vm_template_id, user, specs, template, order_id):
)
if 'pass' in user:
on_user = user.get('email')
on_user = user.get('username')
on_pass = user.get('pass')
logger.debug("Using user {user} to create VM".format(user=on_user))
vm_name = None

View file

@ -1173,6 +1173,7 @@ class OrderConfirmationView(DetailView, FormView):
user = {
'name': custom_user.name,
'email': custom_user.email,
'username': custom_user.username,
'pass': custom_user.password,
'request_scheme': request.scheme,
'request_host': request.get_host(),

View file

@ -1227,6 +1227,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView, FormView):
user = {
'name': self.request.user.name,
'email': self.request.user.email,
'username': self.request.user.username,
'pass': self.request.user.password,
'request_scheme': request.scheme,
'request_host': request.get_host(),