Merge branch 'master' into task/3774/update_stripe_subscription_on_vm_delete
This commit is contained in:
commit
1306dbe46a
158 changed files with 4279 additions and 2015 deletions
|
|
@ -268,6 +268,8 @@ class SignupValidatedView(SignupValidateView):
|
|||
login_url = '<a href="' + \
|
||||
reverse('hosting:login') + '">' + str(_('login')) + '</a>'
|
||||
section_title = _('Account activation')
|
||||
user = CustomUser.objects.filter(
|
||||
validation_slug=self.kwargs['validate_slug']).first()
|
||||
if validated:
|
||||
message = ('{account_activation_string} <br />'
|
||||
' {login_string} {lurl}.').format(
|
||||
|
|
@ -275,6 +277,21 @@ class SignupValidatedView(SignupValidateView):
|
|||
"Your account has been activated."),
|
||||
login_string=_("You can now"),
|
||||
lurl=login_url)
|
||||
email_data = {
|
||||
'subject': _('Welcome to Data Center Light!'),
|
||||
'to': user.email,
|
||||
'context': {
|
||||
'base_url': "{0}://{1}".format(
|
||||
self.request.scheme,
|
||||
self.request.get_host()
|
||||
)
|
||||
},
|
||||
'template_name': 'welcome_user',
|
||||
'template_path': 'datacenterlight/emails/',
|
||||
'from_address': settings.DCL_SUPPORT_FROM_ADDRESS,
|
||||
}
|
||||
email = BaseEmail(**email_data)
|
||||
email.send()
|
||||
else:
|
||||
home_url = '<a href="' + \
|
||||
reverse('datacenterlight:index') + \
|
||||
|
|
@ -687,6 +704,7 @@ class OrdersHostingDetailView(LoginRequiredMixin,
|
|||
disk_size=context['vm']['disk_size'],
|
||||
memory=context['vm']['memory']
|
||||
)
|
||||
context['subscription_end_date'] = vm_detail.end_date()
|
||||
except VMDetail.DoesNotExist:
|
||||
try:
|
||||
manager = OpenNebulaManager(
|
||||
|
|
@ -1049,6 +1067,7 @@ class VirtualMachineView(LoginRequiredMixin, View):
|
|||
|
||||
try:
|
||||
vm_data = VirtualMachineSerializer(manager.get_vm(vm.id)).data
|
||||
vm_name = vm_data.get('name')
|
||||
except WrongIdError:
|
||||
return redirect(reverse('hosting:virtual_machines'))
|
||||
|
||||
|
|
@ -1120,10 +1139,11 @@ class VirtualMachineView(LoginRequiredMixin, View):
|
|||
else:
|
||||
sleep(2)
|
||||
context = {
|
||||
'vm': vm_data,
|
||||
'vm_name': vm_name,
|
||||
'base_url': "{0}://{1}".format(self.request.scheme,
|
||||
self.request.get_host()),
|
||||
'page_header': _('Virtual Machine Cancellation')
|
||||
'page_header': _('Virtual Machine %(vm_name)s Cancelled') % {
|
||||
'vm_name': vm_name}
|
||||
}
|
||||
email_data = {
|
||||
'subject': context['page_header'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue