Added status field to a booked VM. Added the capability to change a booked VM status from the admin panel. Send email to user after his VM is approved

This commit is contained in:
Levi 2016-05-27 00:51:10 -05:00
commit c33c4f4148
14 changed files with 177 additions and 15 deletions

View file

@ -16,11 +16,8 @@ class BaseEmail(object):
self.subject = kwargs.get('subject')
self.context = kwargs.get('context', {})
self.template_full_path = '%s%s' % (self.template_path, self.template_name)
text_content = render_to_string('%s.txt' % self.template_full_path,
{'data': self.context})
html_content = render_to_string('%s.html' % self.template_full_path,
{'data': self.context})
text_content = render_to_string('%s.txt' % self.template_full_path, self.context)
html_content = render_to_string('%s.html' % self.template_full_path, self.context)
self.email = EmailMultiAlternatives(self.subject, text_content)
self.email.attach_alternative(html_content, "text/html")