From f044b83b8f1be5220270dbb12980459c5d2a7b69 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 3 Oct 2017 13:06:26 +0200 Subject: [PATCH 01/28] Add Stripe unsubscribe_customer method --- utils/stripe_utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/utils/stripe_utils.py b/utils/stripe_utils.py index 8fcf0ab1..58840be0 100644 --- a/utils/stripe_utils.py +++ b/utils/stripe_utils.py @@ -232,6 +232,17 @@ class StripeUtils(object): ) return subscription_result + @handleStripeError + def unsubscribe_customer(self, subscription_id): + """ + Cancels a given subscription + + :param subscription_id: The Stripe subscription id string + :return: + """ + sub = stripe.Subscription.retrieve(subscription_id) + return sub.delete() + @handleStripeError def make_payment(self, customer, amount, token): charge = self.stripe.Charge.create( From 777aab711503d268767ba096043073df79129066 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 3 Oct 2017 13:07:41 +0200 Subject: [PATCH 02/28] Add cancel subscription code on VM cancel --- hosting/views.py | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/hosting/views.py b/hosting/views.py index 6d4f15ca..d534ccbe 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -11,6 +11,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.tokens import default_token_generator from django.core.exceptions import ValidationError from django.core.files.base import ContentFile +from django.core.mail import EmailMessage from django.core.urlresolvers import reverse_lazy, reverse from django.http import Http404, HttpResponseRedirect, HttpResponse @@ -1071,6 +1072,52 @@ class VirtualMachineView(LoginRequiredMixin, View): vm_id=opennebula_vm_id).first() vm_detail_obj.terminated_at = datetime.utcnow() vm_detail_obj.save() + # Cancel subscription + stripe_utils = StripeUtils() + error_msg_subject = ( + 'Error canceling subscription for ' + '{user} and vm id {vm_id}'.format( + user=owner.email, + vm_id=opennebula_vm_id + ) + ) + try: + hosting_order = HostingOrder.objects.get( + vm_id=opennebula_vm_id + ) + result = stripe_utils.unsubscribe_customer( + subscription_id=hosting_order.subscription_id + ) + stripe_subscription_obj = result.get( + 'response_object') + # Check if the subscription was canceled + if (stripe_subscription_obj is None or + stripe_subscription_obj.status != 'canceled'): + error_msg = result.get('error') + logger.error(error_msg) + email_data = { + 'subject': error_msg_subject, + 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, + 'to': settings.DCL_ERROR_EMAILS_TO_LIST, + 'body': error_msg, + } + email = EmailMessage(**email_data) + email.send() + except HostingOrder.DoesNotExist: + error_msg = ( + "HostingOrder corresponding to vm_id={vm_id} does" + "not exist. Hence, can not find subscription to " + "cancel ".format(vm_id=opennebula_vm_id) + ) + logger.error(error_msg) + email_data = { + 'subject': error_msg_subject, + 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, + 'to': settings.DCL_ERROR_EMAILS_TO_LIST, + 'body': error_msg, + } + email = EmailMessage(**email_data) + email.send() break except BaseException: break From a04aa8542d7f12760596973ca12343a26eb48b57 Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 12 Dec 2017 22:55:30 +0100 Subject: [PATCH 03/28] Add some logger debug messages --- hosting/views.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index bfb420f0..66df04ba 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -1012,7 +1012,7 @@ class VirtualMachineView(LoginRequiredMixin, View): ) return None except Exception as error: - print(error) + logger.error(str(error)) raise Http404() def get_success_url(self): @@ -1068,12 +1068,17 @@ class VirtualMachineView(LoginRequiredMixin, View): try: vm_data = VirtualMachineSerializer(manager.get_vm(vm.id)).data vm_name = vm_data.get('name') - except WrongIdError: + except WrongIdError as wrong_id_err: + logger.error(str(wrong_id_err)) return redirect(reverse('hosting:virtual_machines')) terminated = manager.delete_vm(vm.id) if not terminated: + logger.debug( + "manager.delete_vm returned False. Hence, error making " + "xml-rpc call to delete vm failed." + ) response['text'] = ugettext( 'Error terminating VM') + opennebula_vm_id else: @@ -1084,7 +1089,8 @@ class VirtualMachineView(LoginRequiredMixin, View): response['status'] = True response['text'] = ugettext('Terminated') vm_detail_obj = VMDetail.objects.filter( - vm_id=opennebula_vm_id).first() + vm_id=opennebula_vm_id + ).first() vm_detail_obj.terminated_at = datetime.utcnow() vm_detail_obj.save() # Cancel subscription From b4e26ac51f3398e5bf1dae1952346191535617dc Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 12 Dec 2017 23:56:39 +0100 Subject: [PATCH 04/28] Add delete_vm_task (wip) --- datacenterlight/tasks.py | 66 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/datacenterlight/tasks.py b/datacenterlight/tasks.py index 3db6eb54..422a6b6d 100644 --- a/datacenterlight/tasks.py +++ b/datacenterlight/tasks.py @@ -1,4 +1,5 @@ from datetime import datetime +from time import sleep from celery.exceptions import MaxRetriesExceededError from celery.utils.log import get_task_logger @@ -8,6 +9,7 @@ from django.core.mail import EmailMessage from django.core.urlresolvers import reverse from django.utils import translation from django.utils.translation import ugettext_lazy as _ +from oca.pool import WrongIdError from dynamicweb.celery import app from hosting.models import HostingOrder, HostingBill @@ -219,3 +221,67 @@ def create_vm_task(self, vm_template_id, user, specs, template, return return vm_id + + +@app.task(bind=True, max_retries=settings.CELERY_MAX_RETRIES) +def delete_vm_task(self, user_id, vm_id): + return_value = False + owner = CustomUser.objects.get(id=user_id) + logger.debug( + "Running delete_vm_task on {host} for {user} and VM {vm_id}".format( + host=current_task.request.hostname, user=owner.email, + vm_id=vm_id + ) + ) + + manager = OpenNebulaManager( + email=owner.email, + password=owner.password + ) + + terminated = manager.delete_vm(vm_id) + + try: + if not terminated: + logger.error( + "manager.delete_vm returned False. Hence, error making " + "xml-rpc call to delete vm failed." + ) + else: + logger.debug("Start polling for delete vm") + for t in range(15): + try: + manager.get_vm(vm_id) + except BaseException as base_exception: + logger.error( + "manager.get_vm returned exception: {details}. Hence, " + "the vm with id {vm_id} is no more accessible".format( + details=str(base_exception), vm_id=vm_id + ) + ) + return_value = True + break + else: + sleep(5) + if return_value is False: + raise Exception("Could not delete vm {}".format(vm_id)) + except Exception as e: + logger.error(str(e)) + try: + retry_task(self) + except MaxRetriesExceededError: + msg_text = 'Finished {} retries for delete_vm_task'.format( + self.request.retries + ) + logger.error(msg_text) + # Try sending email and stop + email_data = { + 'subject': '{} CELERY TASK ERROR: {}'.format(settings.DCL_TEXT, + msg_text), + 'from_email': current_task.request.hostname, + 'to': settings.DCL_ERROR_EMAILS_TO_LIST, + 'body': ',\n'.join(str(i) for i in self.request.args) + } + email = EmailMessage(**email_data) + email.send() + return return_value From 8356c3bf95b41a12be6c8aa7efb71ddf4a4d40ee Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 17 Dec 2017 19:27:45 +0100 Subject: [PATCH 05/28] Refactor some code --- datacenterlight/tasks.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/datacenterlight/tasks.py b/datacenterlight/tasks.py index 422a6b6d..cd50610c 100644 --- a/datacenterlight/tasks.py +++ b/datacenterlight/tasks.py @@ -233,15 +233,14 @@ def delete_vm_task(self, user_id, vm_id): vm_id=vm_id ) ) - - manager = OpenNebulaManager( - email=owner.email, - password=owner.password - ) - - terminated = manager.delete_vm(vm_id) - try: + manager = OpenNebulaManager( + email=owner.email, + password=owner.password + ) + + terminated = manager.delete_vm(vm_id) + if not terminated: logger.error( "manager.delete_vm returned False. Hence, error making " @@ -249,6 +248,8 @@ def delete_vm_task(self, user_id, vm_id): ) else: logger.debug("Start polling for delete vm") + # Time between two get_vm polls in seconds + inter_get_vm_poll_time = 5 for t in range(15): try: manager.get_vm(vm_id) @@ -262,7 +263,13 @@ def delete_vm_task(self, user_id, vm_id): return_value = True break else: - sleep(5) + logger.debug( + "VM {vm_id} is still accessible. So, sleeping for " + "{sleep_time} and then retrying".format( + vm_id=vm_id, sleep_time=inter_get_vm_poll_time + ) + ) + sleep(inter_get_vm_poll_time) if return_value is False: raise Exception("Could not delete vm {}".format(vm_id)) except Exception as e: From 78fa06aa948ffc859fee49744244a1486cda534b Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 17 Dec 2017 19:35:38 +0100 Subject: [PATCH 06/28] Log exception details --- datacenterlight/tasks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/datacenterlight/tasks.py b/datacenterlight/tasks.py index cd50610c..36c399de 100644 --- a/datacenterlight/tasks.py +++ b/datacenterlight/tasks.py @@ -9,7 +9,6 @@ from django.core.mail import EmailMessage from django.core.urlresolvers import reverse from django.utils import translation from django.utils.translation import ugettext_lazy as _ -from oca.pool import WrongIdError from dynamicweb.celery import app from hosting.models import HostingOrder, HostingBill @@ -273,6 +272,12 @@ def delete_vm_task(self, user_id, vm_id): if return_value is False: raise Exception("Could not delete vm {}".format(vm_id)) except Exception as e: + logger.error( + "An exception occurred while deleting VM {vm_id}. Details " + "below".format( + vm_id=vm_id + ) + ) logger.error(str(e)) try: retry_task(self) From 7d683e125786b166d3943b93f8e469d99519f032 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 17 Dec 2017 20:20:42 +0100 Subject: [PATCH 07/28] Move Stripe subscription cancelation before deleting vm --- hosting/views.py | 97 ++++++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 66df04ba..9ce1a9a4 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -1060,6 +1060,53 @@ class VirtualMachineView(LoginRequiredMixin, View): opennebula_vm_id = self.kwargs.get('pk') + # Cancel subscription + stripe_utils = StripeUtils() + error_msg_subject = ( + 'Error canceling subscription for ' + '{user} and vm id {vm_id}'.format( + user=owner.email, + vm_id=opennebula_vm_id + ) + ) + try: + hosting_order = HostingOrder.objects.get( + vm_id=opennebula_vm_id + ) + result = stripe_utils.unsubscribe_customer( + subscription_id=hosting_order.subscription_id + ) + stripe_subscription_obj = result.get('response_object') + # Check if the subscription was canceled + if (stripe_subscription_obj is None or + stripe_subscription_obj.status != 'canceled'): + error_msg = result.get('error') + logger.error(error_msg_subject) + logger.error(error_msg) + email_data = { + 'subject': error_msg_subject, + 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, + 'to': settings.DCL_ERROR_EMAILS_TO_LIST, + 'body': error_msg, + } + email = EmailMessage(**email_data) + email.send() + except HostingOrder.DoesNotExist: + error_msg = ( + "HostingOrder corresponding to vm_id={vm_id} does" + "not exist. Hence, can not find subscription to " + "cancel ".format(vm_id=opennebula_vm_id) + ) + logger.error(error_msg) + email_data = { + 'subject': error_msg_subject, + 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, + 'to': settings.DCL_ERROR_EMAILS_TO_LIST, + 'body': error_msg, + } + email = EmailMessage(**email_data) + email.send() + manager = OpenNebulaManager( email=owner.email, password=owner.password @@ -1093,54 +1140,14 @@ class VirtualMachineView(LoginRequiredMixin, View): ).first() vm_detail_obj.terminated_at = datetime.utcnow() vm_detail_obj.save() - # Cancel subscription - stripe_utils = StripeUtils() - error_msg_subject = ( - 'Error canceling subscription for ' - '{user} and vm id {vm_id}'.format( - user=owner.email, + except BaseException as base_exception: + logger.error( + "manager.get_vm returned exception: {details}. Hence, " + "the vm with id {vm_id} is no more accessible".format( + details=str(base_exception), vm_id=opennebula_vm_id ) ) - try: - hosting_order = HostingOrder.objects.get( - vm_id=opennebula_vm_id - ) - result = stripe_utils.unsubscribe_customer( - subscription_id=hosting_order.subscription_id - ) - stripe_subscription_obj = result.get( - 'response_object') - # Check if the subscription was canceled - if (stripe_subscription_obj is None or - stripe_subscription_obj.status != 'canceled'): - error_msg = result.get('error') - logger.error(error_msg) - email_data = { - 'subject': error_msg_subject, - 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, - 'to': settings.DCL_ERROR_EMAILS_TO_LIST, - 'body': error_msg, - } - email = EmailMessage(**email_data) - email.send() - except HostingOrder.DoesNotExist: - error_msg = ( - "HostingOrder corresponding to vm_id={vm_id} does" - "not exist. Hence, can not find subscription to " - "cancel ".format(vm_id=opennebula_vm_id) - ) - logger.error(error_msg) - email_data = { - 'subject': error_msg_subject, - 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, - 'to': settings.DCL_ERROR_EMAILS_TO_LIST, - 'body': error_msg, - } - email = EmailMessage(**email_data) - email.send() - break - except BaseException: break else: sleep(2) From 96de92d3126c0897f22ab40a02c104958ca48e4c Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 20 Dec 2017 20:59:46 +0100 Subject: [PATCH 08/28] Reorganize code --- hosting/views.py | 97 ++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 52 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 9ce1a9a4..cc7c7657 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -42,6 +42,7 @@ from utils.forms import ( from utils.hosting_utils import get_vm_price from utils.mailer import BaseEmail from utils.stripe_utils import StripeUtils +from utils.tasks import send_plain_email_task from utils.views import ( PasswordResetViewMixin, PasswordResetConfirmViewMixin, LoginViewMixin, ResendActivationLinkViewMixin @@ -1055,23 +1056,26 @@ class VirtualMachineView(LoginRequiredMixin, View): def post(self, request, *args, **kwargs): response = {'status': False} + admin_email_body = {} owner = self.request.user vm = self.get_object() - opennebula_vm_id = self.kwargs.get('pk') - - # Cancel subscription - stripe_utils = StripeUtils() - error_msg_subject = ( - 'Error canceling subscription for ' - '{user} and vm id {vm_id}'.format( - user=owner.email, - vm_id=opennebula_vm_id - ) + manager = OpenNebulaManager( + email=owner.email, + password=owner.password ) + try: + vm_data = VirtualMachineSerializer(manager.get_vm(vm.id)).data + vm_name = vm_data.get('name') + except WrongIdError as wrong_id_err: + logger.error(str(wrong_id_err)) + return redirect(reverse('hosting:virtual_machines')) + + # Cancel Stripe subscription + stripe_utils = StripeUtils() try: hosting_order = HostingOrder.objects.get( - vm_id=opennebula_vm_id + vm_id=vm.id ) result = stripe_utils.unsubscribe_customer( subscription_id=hosting_order.subscription_id @@ -1081,43 +1085,20 @@ class VirtualMachineView(LoginRequiredMixin, View): if (stripe_subscription_obj is None or stripe_subscription_obj.status != 'canceled'): error_msg = result.get('error') - logger.error(error_msg_subject) + logger.error( + 'Error canceling subscription for {user} and vm id ' + '{vm_id}'.format(user=owner.email, vm_id=vm.id) + ) logger.error(error_msg) - email_data = { - 'subject': error_msg_subject, - 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, - 'to': settings.DCL_ERROR_EMAILS_TO_LIST, - 'body': error_msg, - } - email = EmailMessage(**email_data) - email.send() + admin_email_body['stripe_error_msg'] = error_msg except HostingOrder.DoesNotExist: error_msg = ( "HostingOrder corresponding to vm_id={vm_id} does" "not exist. Hence, can not find subscription to " - "cancel ".format(vm_id=opennebula_vm_id) + "cancel ".format(vm_id=vm.id) ) logger.error(error_msg) - email_data = { - 'subject': error_msg_subject, - 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, - 'to': settings.DCL_ERROR_EMAILS_TO_LIST, - 'body': error_msg, - } - email = EmailMessage(**email_data) - email.send() - - manager = OpenNebulaManager( - email=owner.email, - password=owner.password - ) - - try: - vm_data = VirtualMachineSerializer(manager.get_vm(vm.id)).data - vm_name = vm_data.get('name') - except WrongIdError as wrong_id_err: - logger.error(str(wrong_id_err)) - return redirect(reverse('hosting:virtual_machines')) + admin_email_body['stripe_error_msg'] = error_msg terminated = manager.delete_vm(vm.id) @@ -1126,26 +1107,24 @@ class VirtualMachineView(LoginRequiredMixin, View): "manager.delete_vm returned False. Hence, error making " "xml-rpc call to delete vm failed." ) - response['text'] = ugettext( - 'Error terminating VM') + opennebula_vm_id + response['text'] = ugettext('Error terminating VM') + vm.id else: for t in range(15): try: - manager.get_vm(opennebula_vm_id) + manager.get_vm(vm.id) except WrongIdError: response['status'] = True response['text'] = ugettext('Terminated') vm_detail_obj = VMDetail.objects.filter( - vm_id=opennebula_vm_id + vm_id=vm.id ).first() vm_detail_obj.terminated_at = datetime.utcnow() vm_detail_obj.save() except BaseException as base_exception: logger.error( - "manager.get_vm returned exception: {details}. Hence, " - "the vm with id {vm_id} is no more accessible".format( - details=str(base_exception), - vm_id=opennebula_vm_id + "manager.get_vm({vm_id}) returned exception: " + "{details}.".format( + details=str(base_exception), vm_id=vm.id ) ) break @@ -1153,10 +1132,12 @@ class VirtualMachineView(LoginRequiredMixin, View): sleep(2) context = { 'vm_name': vm_name, - 'base_url': "{0}://{1}".format(self.request.scheme, - self.request.get_host()), + 'base_url': "{0}://{1}".format( + self.request.scheme, self.request.get_host() + ), 'page_header': _('Virtual Machine %(vm_name)s Cancelled') % { - 'vm_name': vm_name} + 'vm_name': vm_name + } } email_data = { 'subject': context['page_header'], @@ -1168,6 +1149,18 @@ class VirtualMachineView(LoginRequiredMixin, View): } email = BaseEmail(**email_data) email.send() + admin_email_body.update(response) + email_to_admin_data = { + 'subject': "Deleted Subscription for VM: {vm_id} and " + "user: {user}".format( + vm_id=vm.id, user=owner.email + ), + 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, + 'to': ['info@ungleich.ch'], + 'body': "\n".join( + ["%s=%s" % (k, v) for (k, v) in admin_email_body]), + } + send_plain_email_task.delay(email_to_admin_data) return HttpResponse( json.dumps(response), content_type="application/json" From f61abf44c8955813c7c9cc362cc399959177c883 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 20 Dec 2017 21:28:07 +0100 Subject: [PATCH 09/28] Remove unused import --- hosting/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/hosting/views.py b/hosting/views.py index cc7c7657..42051049 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -11,7 +11,6 @@ from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.tokens import default_token_generator from django.core.exceptions import ValidationError from django.core.files.base import ContentFile -from django.core.mail import EmailMessage from django.core.urlresolvers import reverse_lazy, reverse from django.http import Http404, HttpResponseRedirect, HttpResponse From 77002a1c9eac023970c52eadff0243d9e77abadf Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 20 Dec 2017 21:32:02 +0100 Subject: [PATCH 10/28] Revert back celery task for delete_vm. Better to do it in another PR. --- datacenterlight/tasks.py | 78 ---------------------------------------- 1 file changed, 78 deletions(-) diff --git a/datacenterlight/tasks.py b/datacenterlight/tasks.py index 36c399de..3db6eb54 100644 --- a/datacenterlight/tasks.py +++ b/datacenterlight/tasks.py @@ -1,5 +1,4 @@ from datetime import datetime -from time import sleep from celery.exceptions import MaxRetriesExceededError from celery.utils.log import get_task_logger @@ -220,80 +219,3 @@ def create_vm_task(self, vm_template_id, user, specs, template, return return vm_id - - -@app.task(bind=True, max_retries=settings.CELERY_MAX_RETRIES) -def delete_vm_task(self, user_id, vm_id): - return_value = False - owner = CustomUser.objects.get(id=user_id) - logger.debug( - "Running delete_vm_task on {host} for {user} and VM {vm_id}".format( - host=current_task.request.hostname, user=owner.email, - vm_id=vm_id - ) - ) - try: - manager = OpenNebulaManager( - email=owner.email, - password=owner.password - ) - - terminated = manager.delete_vm(vm_id) - - if not terminated: - logger.error( - "manager.delete_vm returned False. Hence, error making " - "xml-rpc call to delete vm failed." - ) - else: - logger.debug("Start polling for delete vm") - # Time between two get_vm polls in seconds - inter_get_vm_poll_time = 5 - for t in range(15): - try: - manager.get_vm(vm_id) - except BaseException as base_exception: - logger.error( - "manager.get_vm returned exception: {details}. Hence, " - "the vm with id {vm_id} is no more accessible".format( - details=str(base_exception), vm_id=vm_id - ) - ) - return_value = True - break - else: - logger.debug( - "VM {vm_id} is still accessible. So, sleeping for " - "{sleep_time} and then retrying".format( - vm_id=vm_id, sleep_time=inter_get_vm_poll_time - ) - ) - sleep(inter_get_vm_poll_time) - if return_value is False: - raise Exception("Could not delete vm {}".format(vm_id)) - except Exception as e: - logger.error( - "An exception occurred while deleting VM {vm_id}. Details " - "below".format( - vm_id=vm_id - ) - ) - logger.error(str(e)) - try: - retry_task(self) - except MaxRetriesExceededError: - msg_text = 'Finished {} retries for delete_vm_task'.format( - self.request.retries - ) - logger.error(msg_text) - # Try sending email and stop - email_data = { - 'subject': '{} CELERY TASK ERROR: {}'.format(settings.DCL_TEXT, - msg_text), - 'from_email': current_task.request.hostname, - 'to': settings.DCL_ERROR_EMAILS_TO_LIST, - 'body': ',\n'.join(str(i) for i in self.request.args) - } - email = EmailMessage(**email_data) - email.send() - return return_value From 2628312bb9676382eb20aa7967a3324638335ec7 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 20 Dec 2017 22:26:36 +0100 Subject: [PATCH 11/28] Fix a bug and update delete vm email subject --- hosting/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 42051049..e1231dc5 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -1150,14 +1150,14 @@ class VirtualMachineView(LoginRequiredMixin, View): email.send() admin_email_body.update(response) email_to_admin_data = { - 'subject': "Deleted Subscription for VM: {vm_id} and " + 'subject': "Deleted VM and Subscription for VM {vm_id} and " "user: {user}".format( vm_id=vm.id, user=owner.email ), 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, 'to': ['info@ungleich.ch'], 'body': "\n".join( - ["%s=%s" % (k, v) for (k, v) in admin_email_body]), + ["%s=%s" % (k, v) for (k, v) in admin_email_body.items()]), } send_plain_email_task.delay(email_to_admin_data) return HttpResponse( From 4dff4e07cb7614d0589e844c59e696376f790ed1 Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 21 Dec 2017 01:25:52 +0100 Subject: [PATCH 12/28] Change minimum required RAM from 2GB to 1GB --- datacenterlight/locale/de/LC_MESSAGES/django.po | 14 ++++++++++---- datacenterlight/static/datacenterlight/js/main.js | 4 ++-- .../templates/datacenterlight/calculator_form.html | 4 ++-- datacenterlight/views.py | 2 +- hosting/locale/de/LC_MESSAGES/django.po | 9 ++++++--- hosting/static/hosting/js/createvm.js | 4 ++-- hosting/templates/hosting/calculator_form.html | 4 ++-- hosting/views.py | 2 +- 8 files changed, 26 insertions(+), 17 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index c69f83d1..76cd5c9c 100644 --- a/datacenterlight/locale/de/LC_MESSAGES/django.po +++ b/datacenterlight/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-11-13 17:59+0000\n" +"POT-Creation-Date: 2017-12-21 00:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -56,11 +56,11 @@ msgstr "Standort: Schweiz" msgid "Please enter a value in range 1 - 48." msgstr "Bitte gib einen Wert von 1 bis 48 ein." -msgid "Please enter a value in range 2 - 200." -msgstr "Bitte gib einen Wert von 2 bis 200 ein." +msgid "Please enter a value in range 1 - 200." +msgstr "Bitte gib einen Wert von 1 bis 200 ein." msgid "Please enter a value in range 10 - 2000." -msgstr "Bitte gib einen Wert von 10 bis 200 ein." +msgstr "Bitte gib einen Wert von 10 bis 2000 ein." msgid "GB Storage (SSD)" msgstr "GB Storage (SSD)" @@ -316,6 +316,9 @@ msgstr "" msgid "Forgot password?" msgstr "Passwort vergessen?" +msgid "Resend activation link" +msgstr "Aktivierungslink noch einmal senden" + msgid "Sign up" msgstr "Registrieren" @@ -517,6 +520,9 @@ msgstr "" "Deine VM ist gleich bereit. Wir senden Dir eine Bestätigungsemail, sobald Du " "auf sie zugreifen kannst." +#~ msgid "Please enter a value in range 2 - 200." +#~ msgstr "Bitte gib einen Wert von 2 bis 200 ein." + #~ msgid "Affordable VM hosting based in Switzerland" #~ msgstr "Bezahlbares VM Hosting in der Schweiz" diff --git a/datacenterlight/static/datacenterlight/js/main.js b/datacenterlight/static/datacenterlight/js/main.js index dd074397..aa33c0d6 100644 --- a/datacenterlight/static/datacenterlight/js/main.js +++ b/datacenterlight/static/datacenterlight/js/main.js @@ -15,8 +15,8 @@ }, 'ram': { 'id': 'ramValue', - 'value': 2, - 'min': 2, + 'value': 1, + 'min': 1, 'max': 200, 'interval': 1 }, diff --git a/datacenterlight/templates/datacenterlight/calculator_form.html b/datacenterlight/templates/datacenterlight/calculator_form.html index 1733a719..dcab80b3 100644 --- a/datacenterlight/templates/datacenterlight/calculator_form.html +++ b/datacenterlight/templates/datacenterlight/calculator_form.html @@ -36,8 +36,8 @@
- + GB RAM
diff --git a/datacenterlight/views.py b/datacenterlight/views.py index bd1a7f51..fda8c9c9 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -209,7 +209,7 @@ class IndexView(CreateView): raise ValidationError(_('Invalid number of cores')) def validate_memory(self, value): - if (value > 200) or (value < 2): + if (value > 200) or (value < 1): raise ValidationError(_('Invalid RAM size')) def validate_storage(self, value): diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 2be2ae6d..19cffda5 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-10-26 03:21+0530\n" +"POT-Creation-Date: 2017-12-21 00:23+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -128,8 +128,8 @@ msgstr "MwSt. inklusive" msgid "Please enter a value in range 1 - 48." msgstr "Bitte gib einen Wert von 1 bis 48 ein." -msgid "Please enter a value in range 2 - 200." -msgstr "Bitte gib einen Wert von 2 bis 200 ein." +msgid "Please enter a value in range 1 - 200." +msgstr "Bitte gib einen Wert von 1 bis 200 ein." msgid "Please enter a value in range 10 - 2000." msgstr "Bitte gib einen Wert von 10 bis 200 ein." @@ -722,6 +722,9 @@ msgstr "" "Es gab einen Fehler bei der Bearbeitung Deine Anfrage. Bitte versuche es " "noch einmal." +#~ msgid "Please enter a value in range 2 - 200." +#~ msgstr "Bitte gib einen Wert von 2 bis 200 ein." + #~ msgid "Reset your password" #~ msgstr "Passwort zurücksetzen" diff --git a/hosting/static/hosting/js/createvm.js b/hosting/static/hosting/js/createvm.js index 726513ad..219fb3b7 100644 --- a/hosting/static/hosting/js/createvm.js +++ b/hosting/static/hosting/js/createvm.js @@ -11,8 +11,8 @@ }, 'ram': { 'id': 'ramValue', - 'value': 2, - 'min': 2, + 'value': 1, + 'min': 1, 'max': 200, 'interval': 1 }, diff --git a/hosting/templates/hosting/calculator_form.html b/hosting/templates/hosting/calculator_form.html index 18bdd3cb..02bb36ea 100644 --- a/hosting/templates/hosting/calculator_form.html +++ b/hosting/templates/hosting/calculator_form.html @@ -29,8 +29,8 @@
- + GB RAM
diff --git a/hosting/views.py b/hosting/views.py index 978abf28..70ca259e 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -943,7 +943,7 @@ class CreateVirtualMachinesView(LoginRequiredMixin, View): raise ValidationError(_('Invalid number of cores')) def validate_memory(self, value): - if (value > 200) or (value < 2): + if (value > 200) or (value < 1): raise ValidationError(_('Invalid RAM size')) def validate_storage(self, value): From 3852ce04de0b1982bd14b3fc155b7f34e011a118 Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 21 Dec 2017 08:41:26 +0100 Subject: [PATCH 13/28] Set default RAM value to 2G in landing and hosting VM calculators --- datacenterlight/static/datacenterlight/js/main.js | 2 +- hosting/static/hosting/js/createvm.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/datacenterlight/static/datacenterlight/js/main.js b/datacenterlight/static/datacenterlight/js/main.js index aa33c0d6..4c50702e 100644 --- a/datacenterlight/static/datacenterlight/js/main.js +++ b/datacenterlight/static/datacenterlight/js/main.js @@ -15,7 +15,7 @@ }, 'ram': { 'id': 'ramValue', - 'value': 1, + 'value': 2, 'min': 1, 'max': 200, 'interval': 1 diff --git a/hosting/static/hosting/js/createvm.js b/hosting/static/hosting/js/createvm.js index 219fb3b7..8d525114 100644 --- a/hosting/static/hosting/js/createvm.js +++ b/hosting/static/hosting/js/createvm.js @@ -11,7 +11,7 @@ }, 'ram': { 'id': 'ramValue', - 'value': 1, + 'value': 2, 'min': 1, 'max': 200, 'interval': 1 From 3e48b936f4fa8e521f1193e3b8d3e7aadfd0fc18 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 22 Dec 2017 23:03:58 +0100 Subject: [PATCH 14/28] Update Changelog --- Changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog b/Changelog index d3c2c549..adc81a25 100644 --- a/Changelog +++ b/Changelog @@ -2,6 +2,8 @@ Next: * #3911: [dcl] Integrate resend activation link into dcl landing payment page * #3972: [hosting] Add ungleich company info to invoice footer * #3974: [hosting] Improve invoice number: Show 404 for invoice resources that do not belong to the user + * [ungleich] Add video cover to the header on ungleich.ch landing page and add corresponding cms plugin + * #3774: [hosting] |Update Stripe subscription on vm delete 1.2.13: 2017-12-09 * [cms] Introduce UngleichHeaderBackgroundImageAndTextSliderPlugin that allows to have scrolling images and texts * [cms] Remove

tag for ungleich cms customer item template From 57c5255708292f68675de60216bc01c18abe12c1 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 22 Dec 2017 23:37:49 +0100 Subject: [PATCH 15/28] Update translation in DE : 200 to 2000 --- hosting/locale/de/LC_MESSAGES/django.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 19cffda5..3575cc61 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -132,7 +132,7 @@ msgid "Please enter a value in range 1 - 200." msgstr "Bitte gib einen Wert von 1 bis 200 ein." msgid "Please enter a value in range 10 - 2000." -msgstr "Bitte gib einen Wert von 10 bis 200 ein." +msgstr "Bitte gib einen Wert von 10 bis 2000 ein." msgid "GB Storage (SSD)" msgstr "GB Storage (SSD)" From 4c73dddb6d6108711765996dd5e21b488d377791 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sat, 23 Dec 2017 04:29:31 +0530 Subject: [PATCH 16/28] text fix for landing --- ungleich_page/locale/de/LC_MESSAGES/django.po | 70 +++++++++---------- .../migrations/0017_auto_20171219_1856.py | 2 +- .../ungleich_page/includes/_about.html | 14 +--- .../ungleich_page/includes/_header.html | 21 ++---- 4 files changed, 44 insertions(+), 63 deletions(-) diff --git a/ungleich_page/locale/de/LC_MESSAGES/django.po b/ungleich_page/locale/de/LC_MESSAGES/django.po index 029137b1..935c625e 100644 --- a/ungleich_page/locale/de/LC_MESSAGES/django.po +++ b/ungleich_page/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-22 01:00+0530\n" +"POT-Creation-Date: 2017-12-23 04:12+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -157,8 +157,37 @@ msgstr "Copyright © ungleich GmbH" msgid "ungleich Home" msgstr "ungleich Home" -msgid "We Design, Configure & Maintain
Your Linux Infrastructure " -msgstr "Wir designen, erstellen und warten
Ihre Linux-Infrastruktur" +msgid "Hosting" +msgstr "Hosting" + +msgid "" +"Ruby on Rails. Java hosting, Django hosting, we make it everything run " +"smooth and safe." +msgstr "" +"Ruby on Rails. Java hosting, Django hosting, wir garantieren einen " +"reibungslosen Ablauf" + +msgid "Configuration as a Service" +msgstr "Konfiguration als Service" + +msgid "" +"Ruby on Rails, Django, Java, Webserver, Mailserver, any infrastructure that " +"needs to configured, we provide comprehensive solutions. Amazon, rackspace " +"or bare metal servers, we configure for you." +msgstr "" +"Ruby on Rails, Django, Java, Webserver, Mailserver, jegliche Infrastruktur " +"welche eine Konfiguration braucht, wir offerieren umfassende Lösungen, " +"Amazon, Rackspace oder Bare Metal Servers, wir konfigurieren alles." + +msgid "Linux System Engineering" +msgstr "Linux System Engineering" + +msgid "" +"Let your developers develop! We take care of your system administration. " +"Gentoo, Archlinux, Debian, Ubuntu, and many more." +msgstr "" +"Lassen sie ihre Entwickler entwickeln! Wir kümmern uns um ihre " +"Systemadministration. Gentoo, Archlinux, Debian, Ubuntu und viele mehr." msgid "Our Products" msgstr "Unsere Produkte" @@ -216,38 +245,6 @@ msgstr "" "Unser erstklassiges Konfigurationsmanagement ist erfrischend einfach und " "zuverlässig." -msgid "Hosting" -msgstr "Hosting" - -msgid "" -"Ruby on Rails. Java hosting, Django hosting, we make it everything run " -"smooth and safe." -msgstr "" -"Ruby on Rails. Java hosting, Django hosting, wir garantieren einen " -"reibungslosen Ablauf" - -msgid "Configuration as a Service" -msgstr "Konfiguration als Service" - -msgid "" -"Ruby on Rails, Django, Java, Webserver, Mailserver, any infrastructure that " -"needs to configured, we provide comprehensive solutions. Amazon, rackspace " -"or bare metal servers, we configure for you." -msgstr "" -"Ruby on Rails, Django, Java, Webserver, Mailserver, jegliche Infrastruktur " -"welche eine Konfiguration braucht, wir offerieren umfassende Lösungen, " -"Amazon, Rackspace oder Bare Metal Servers, wir konfigurieren alles." - -msgid "Linux System Engineering" -msgstr "Linux System Engineering" - -msgid "" -"Let your developers develop! We take care of your system administration. " -"Gentoo, Archlinux, Debian, Ubuntu, and many more." -msgstr "" -"Lassen sie ihre Entwickler entwickeln! Wir kümmern uns um ihre " -"Systemadministration. Gentoo, Archlinux, Debian, Ubuntu und viele mehr." - msgid "Why ungleich?*" msgstr "Warum ungleich?" @@ -363,6 +360,9 @@ msgid "If you have any question, just send us an email." msgstr "" "Wenn Sie irgendwelche Fragen haben, schicken Sie uns einfach eine E-Mail." +#~ msgid "We Design, Configure & Maintain
Your Linux Infrastructure " +#~ msgstr "Wir designen, erstellen und warten
Ihre Linux-Infrastruktur" + #~ msgid "Hosting Products " #~ msgstr "Hosting Produkte" diff --git a/ungleich_page/migrations/0017_auto_20171219_1856.py b/ungleich_page/migrations/0017_auto_20171219_1856.py index 14c137a9..f5d76c50 100644 --- a/ungleich_page/migrations/0017_auto_20171219_1856.py +++ b/ungleich_page/migrations/0017_auto_20171219_1856.py @@ -30,7 +30,7 @@ class Migration(migrations.Migration): blank=True, help_text='Text for the button, if a link is provided.', max_length=50, null=True)), ('heading', models.CharField( blank=True, help_text='An optional title for this slide.', max_length=100, null=True)), - ('video', filer.fields.file.FilerFileField(blank=True, help_text='Leavig this blank will make the image as the background.', + ('video', filer.fields.file.FilerFileField(blank=True, help_text='Leaving this blank will make the image as the background.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ungleich_header_item_video', to='filer.File')), ], options={ diff --git a/ungleich_page/templates/ungleich_page/includes/_about.html b/ungleich_page/templates/ungleich_page/includes/_about.html index 88f8a023..2d1660e8 100644 --- a/ungleich_page/templates/ungleich_page/includes/_about.html +++ b/ungleich_page/templates/ungleich_page/includes/_about.html @@ -93,19 +93,6 @@

-
  • -
    - -
    -
    -
    -

    2017

    -
    -
    -

    {% trans 'ungleich starts computer learning club for locals, "Digitale Building ungleich."' %}

    -
    -
    -
  • @@ -115,6 +102,7 @@

    2017

    +

    {% trans 'ungleich starts computer learning club for locals, "Digitale Building ungleich."' %}

    {% blocktrans %}ungleich sells Alplora to an IoT startup in canton Zürich.{% endblocktrans %}

    {% trans "ungleich showcases the most affordable Swiss VM hosting, Data Center Light." %}

    diff --git a/ungleich_page/templates/ungleich_page/includes/_header.html b/ungleich_page/templates/ungleich_page/includes/_header.html index 4819ec1e..04bbce5d 100644 --- a/ungleich_page/templates/ungleich_page/includes/_header.html +++ b/ungleich_page/templates/ungleich_page/includes/_header.html @@ -18,11 +18,8 @@
    -
    - {% trans "We Design, Configure & Maintain
    Your Linux Infrastructure " %} -
    -

    Ruby on Rails, Django, Java, Webserver, Mailserver, any infrastructure that needs to configured, we provide comprehensive solutions. Amazon, rackspace or bare metal servers, we configure for you.

    - Learn More +
    {% trans "Hosting" %}
    +

    {% trans "Ruby on Rails. Java hosting, Django hosting, we make it everything run smooth and safe." %}

    @@ -33,11 +30,9 @@
    -
    - {% trans "We Design, Configure & Maintain
    Your Linux Infrastructure " %} -
    -

    Ruby on Rails, Django, Nothing else.

    - Learn More +
    {% trans "Configuration as a Service" %}
    +

    {% trans "Ruby on Rails, Django, Java, Webserver, Mailserver, any infrastructure that needs to configured, we provide comprehensive solutions. Amazon, rackspace or bare metal servers, we configure for you." %}

    +
    @@ -47,10 +42,8 @@
    -
    - {% trans "We Design, Configure & Maintain
    Your Linux Infrastructure " %} -
    - Learn More +
    {% trans "Linux System Engineering" %}
    +

    {% trans "Let your developers develop! We take care of your system administration. Gentoo, Archlinux, Debian, Ubuntu, and many more." %}

    From 6c017d15819ac13d1cbacd3479da3eeb9555d382 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 22 Dec 2017 23:59:51 +0100 Subject: [PATCH 17/28] Remove commented translation --- datacenterlight/locale/de/LC_MESSAGES/django.po | 3 --- hosting/locale/de/LC_MESSAGES/django.po | 3 --- 2 files changed, 6 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index e9875d2f..859781b6 100644 --- a/datacenterlight/locale/de/LC_MESSAGES/django.po +++ b/datacenterlight/locale/de/LC_MESSAGES/django.po @@ -520,9 +520,6 @@ msgstr "" "Deine VM ist gleich bereit. Wir senden Dir eine Bestätigungsemail, sobald Du " "auf sie zugreifen kannst." -#~ msgid "Please enter a value in range 2 - 200." -#~ msgstr "Bitte gib einen Wert von 2 bis 200 ein." - #~ msgid "Affordable VM hosting based in Switzerland" #~ msgstr "Bezahlbares VM Hosting in der Schweiz" diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 3575cc61..118245e5 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -722,9 +722,6 @@ msgstr "" "Es gab einen Fehler bei der Bearbeitung Deine Anfrage. Bitte versuche es " "noch einmal." -#~ msgid "Please enter a value in range 2 - 200." -#~ msgstr "Bitte gib einen Wert von 2 bis 200 ein." - #~ msgid "Reset your password" #~ msgstr "Passwort zurücksetzen" From 6ea012571a56453bbe04adb61682b71c85c84b7b Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sat, 23 Dec 2017 04:56:45 +0530 Subject: [PATCH 18/28] reduce section padding --- ungleich_page/static/ungleich_page/css/agency.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ungleich_page/static/ungleich_page/css/agency.css b/ungleich_page/static/ungleich_page/css/agency.css index eca4036b..43a05898 100755 --- a/ungleich_page/static/ungleich_page/css/agency.css +++ b/ungleich_page/static/ungleich_page/css/agency.css @@ -372,7 +372,7 @@ section h3.section-subheading { @media(min-width:768px) { section { - padding: 125px 0; + padding: 80px 0; } section h2.section-heading { font-size: 40px; @@ -985,4 +985,4 @@ section h3.section-comment { .carousel-author { height: 72px; } -} \ No newline at end of file +} From 4870649e93596013139c4ce2dcf672a9c43d4db6 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 23 Dec 2017 00:49:50 +0100 Subject: [PATCH 19/28] Update datacenterlight contact address --- datacenterlight/templates/datacenterlight/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/index.html b/datacenterlight/templates/datacenterlight/index.html index cc3597ec..f8ac4419 100755 --- a/datacenterlight/templates/datacenterlight/index.html +++ b/datacenterlight/templates/datacenterlight/index.html @@ -160,11 +160,11 @@
    -

    ungleich GmbH

    +

    ungleich glarus ag

    info@datacenterlight.ch

    -

    In der Au 7, Schwanden 8762

    +

    Bahnhofstrasse 1, 8783 Linthal

    {% trans "Switzerland " %}

    From 810a540d0864808b6f7131c81066a650186e1f85 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sat, 23 Dec 2017 05:22:21 +0530 Subject: [PATCH 20/28] punctuation fix --- ungleich_page/locale/de/LC_MESSAGES/django.po | 16 ++++++++-------- .../templates/ungleich_page/includes/_about.html | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ungleich_page/locale/de/LC_MESSAGES/django.po b/ungleich_page/locale/de/LC_MESSAGES/django.po index 935c625e..9b4ef07b 100644 --- a/ungleich_page/locale/de/LC_MESSAGES/django.po +++ b/ungleich_page/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-23 04:12+0530\n" +"POT-Creation-Date: 2017-12-23 05:18+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -71,14 +71,14 @@ msgstr "Die Chronik von ungleich" msgid "The first incarnation of ungleich" msgstr "Die erste Inkarnation von ungleich" -msgid "in Germany" -msgstr "in Deutschland" +msgid "in Germany." +msgstr "in Deutschland." msgid "ungleich founded" msgstr "ungleich gegründet" -msgid "in Switzerland" -msgstr "in der Schweiz" +msgid "in Switzerland." +msgstr "in der Schweiz." msgid "ungleich present at various conferences" msgstr "ungleich präsent an mehreren Konferenzen" @@ -107,7 +107,7 @@ msgstr "ungleich bietet einen PC-Grundkurs für Flüchtlinge an." msgid "" "ungleich starts computer learning club for locals, \"Digitale Building " -"ungleich.\"" +"ungleich\"." msgstr "" "ungleich gründet den Verein Digitale Bildung ungleich für Ortsansässige." @@ -116,7 +116,7 @@ msgid "" "startup in canton Zürich." msgstr "" "ungleich verkauft das Projekt AlpLora an ein IoT-Startup aus dem Kanton Zürich" +"\">AlpLora an ein IoT-Startup aus dem Kanton Zürich." msgid "" "ungleich showcases the most affordable Swiss VM hosting, Data Center Light." @@ -165,7 +165,7 @@ msgid "" "smooth and safe." msgstr "" "Ruby on Rails. Java hosting, Django hosting, wir garantieren einen " -"reibungslosen Ablauf" +"reibungslosen Ablauf." msgid "Configuration as a Service" msgstr "Konfiguration als Service" diff --git a/ungleich_page/templates/ungleich_page/includes/_about.html b/ungleich_page/templates/ungleich_page/includes/_about.html index 2d1660e8..ba6717fc 100644 --- a/ungleich_page/templates/ungleich_page/includes/_about.html +++ b/ungleich_page/templates/ungleich_page/includes/_about.html @@ -17,7 +17,7 @@

    {% trans "The first incarnation of ungleich" %}

    -

    {% trans "in Germany" %}

    +

    {% trans "in Germany." %}

  • @@ -31,7 +31,7 @@

    {% trans "ungleich founded" %}

    -

    {% trans "in Switzerland" %}

    +

    {% trans "in Switzerland." %}

    @@ -44,7 +44,7 @@

    2014

    -

    {% trans "ungleich present at various conferences" %}:
    Linuxtag, UCMS, Linux Erfa, ETH Zurich
    +

    {% trans "ungleich present at various conferences" %}:
    Linuxtag, UCMS, Linux Erfa, ETH Zurich.

    @@ -62,7 +62,7 @@

    {% trans "and introduces affordable 24X7 support." %}

    {% trans "ungleich launches" %} - {% trans "Digital Glarus project" %} + {% trans "Digital Glarus project" %}.

    @@ -102,7 +102,7 @@

    2017

    -

    {% trans 'ungleich starts computer learning club for locals, "Digitale Building ungleich."' %}

    +

    {% trans 'ungleich starts computer learning club for locals, "Digitale Building ungleich".' %}

    {% blocktrans %}ungleich sells Alplora to an IoT startup in canton Zürich.{% endblocktrans %}

    {% trans "ungleich showcases the most affordable Swiss VM hosting, Data Center Light." %}

    From f013ac3db4d6c8ff576e94202a02ce06b6dca084 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sat, 23 Dec 2017 05:38:24 +0530 Subject: [PATCH 21/28] Update Changelog --- Changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog b/Changelog index adc81a25..343eb552 100644 --- a/Changelog +++ b/Changelog @@ -4,6 +4,7 @@ Next: * #3974: [hosting] Improve invoice number: Show 404 for invoice resources that do not belong to the user * [ungleich] Add video cover to the header on ungleich.ch landing page and add corresponding cms plugin * #3774: [hosting] |Update Stripe subscription on vm delete + * [ungleich] update text on landing page 1.2.13: 2017-12-09 * [cms] Introduce UngleichHeaderBackgroundImageAndTextSliderPlugin that allows to have scrolling images and texts * [cms] Remove

    tag for ungleich cms customer item template From 9df6bd354db2022096274d847160f2079faa1d74 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 23 Dec 2017 07:12:07 +0100 Subject: [PATCH 22/28] Update Changelog --- Changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 343eb552..f1d46e23 100644 --- a/Changelog +++ b/Changelog @@ -3,8 +3,9 @@ Next: * #3972: [hosting] Add ungleich company info to invoice footer * #3974: [hosting] Improve invoice number: Show 404 for invoice resources that do not belong to the user * [ungleich] Add video cover to the header on ungleich.ch landing page and add corresponding cms plugin - * #3774: [hosting] |Update Stripe subscription on vm delete - * [ungleich] update text on landing page + * #3774: [hosting] Update Stripe subscription on vm delete + * [ungleich] Update text on landing page + * #3601: [dcl, hosting] Change minimum required RAM from 2GB to 1GB 1.2.13: 2017-12-09 * [cms] Introduce UngleichHeaderBackgroundImageAndTextSliderPlugin that allows to have scrolling images and texts * [cms] Remove

    tag for ungleich cms customer item template From 94b1051e85c1ba903e9c357f345ff4ea4268887b Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 23 Dec 2017 18:06:37 +0100 Subject: [PATCH 23/28] Update glasfaser contact address too --- ungleich_page/templates/ungleich_page/glasfaser.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ungleich_page/templates/ungleich_page/glasfaser.html b/ungleich_page/templates/ungleich_page/glasfaser.html index 6bcb0746..7d805721 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser.html +++ b/ungleich_page/templates/ungleich_page/glasfaser.html @@ -220,11 +220,11 @@

    -

    ungleich GmbH

    +

    ungleich glarus ag

    glasfaser@ungleich.ch

    -

    In der Au 7, Schwanden 8762

    +

    Bahnhofstrasse 1, 8783 Linthal/p>

    Switzerland

    From 959e624de8262568899273c6bdbadb64570d556e Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 23 Dec 2017 18:08:57 +0100 Subject: [PATCH 24/28] Fix opening for p tag --- ungleich_page/templates/ungleich_page/glasfaser.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ungleich_page/templates/ungleich_page/glasfaser.html b/ungleich_page/templates/ungleich_page/glasfaser.html index 7d805721..3d8fbb76 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser.html +++ b/ungleich_page/templates/ungleich_page/glasfaser.html @@ -224,7 +224,7 @@

    glasfaser@ungleich.ch

    -

    Bahnhofstrasse 1, 8783 Linthal/p> +

    Bahnhofstrasse 1, 8783 Linthal

    Switzerland

    From 5662cc44c89b81282514fb8fc49291c99599620c Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 23 Dec 2017 18:19:10 +0100 Subject: [PATCH 25/28] Update Changelog --- Changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog b/Changelog index f1d46e23..450d7e85 100644 --- a/Changelog +++ b/Changelog @@ -6,6 +6,7 @@ Next: * #3774: [hosting] Update Stripe subscription on vm delete * [ungleich] Update text on landing page * #3601: [dcl, hosting] Change minimum required RAM from 2GB to 1GB + * #3973: [dcl] Update datacenterlight and glasfaser contact address to Linthal and company name to "ungleich glarus ag" 1.2.13: 2017-12-09 * [cms] Introduce UngleichHeaderBackgroundImageAndTextSliderPlugin that allows to have scrolling images and texts * [cms] Remove

    tag for ungleich cms customer item template From 1f85273fd01bb311aaabda3762ecd6bc087d7e96 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 23 Dec 2017 22:59:16 +0100 Subject: [PATCH 26/28] Set cardholder_name field for UserBillingAddressForm in digital glarus membership payment post --- digitalglarus/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/digitalglarus/views.py b/digitalglarus/views.py index 87c1ccd2..2c438f04 100644 --- a/digitalglarus/views.py +++ b/digitalglarus/views.py @@ -376,6 +376,10 @@ class MembershipPaymentView(LoginRequiredMixin, IsNotMemberMixin, FormView): return render(request, self.template_name, context) charge = charge_response.get('response_object') + if 'source' in charge: + cardholder_name = charge['source']['name'] + else: + cardholder_name = customer.user.email # Create Billing Address billing_address = form.save() @@ -383,7 +387,8 @@ class MembershipPaymentView(LoginRequiredMixin, IsNotMemberMixin, FormView): # Create Billing Address for User if he does not have one if not customer.user.billing_addresses.count(): data.update({ - 'user': customer.user.id + 'user': customer.user.id, + 'cardholder_name': cardholder_name }) billing_address_user_form = UserBillingAddressForm(data) billing_address_user_form.is_valid() From 10bc05f7004d7a7fed32a509a9b27695b85e1bb6 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 23 Dec 2017 23:07:53 +0100 Subject: [PATCH 27/28] User customer's name instead of email for cardholder_name if not provided --- digitalglarus/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/digitalglarus/views.py b/digitalglarus/views.py index 2c438f04..96983d9b 100644 --- a/digitalglarus/views.py +++ b/digitalglarus/views.py @@ -379,7 +379,7 @@ class MembershipPaymentView(LoginRequiredMixin, IsNotMemberMixin, FormView): if 'source' in charge: cardholder_name = charge['source']['name'] else: - cardholder_name = customer.user.email + cardholder_name = customer.user.name # Create Billing Address billing_address = form.save() From fe6bd2a80725687899d89dc3e98a42fde1853c67 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 24 Dec 2017 19:37:29 +0100 Subject: [PATCH 28/28] Update Changelog --- Changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog b/Changelog index 450d7e85..1ad8f324 100644 --- a/Changelog +++ b/Changelog @@ -7,6 +7,7 @@ Next: * [ungleich] Update text on landing page * #3601: [dcl, hosting] Change minimum required RAM from 2GB to 1GB * #3973: [dcl] Update datacenterlight and glasfaser contact address to Linthal and company name to "ungleich glarus ag" + * #3993: [dg] Fix new user membership payment by setting cardholder_name field for UserBillingAddressForm 1.2.13: 2017-12-09 * [cms] Introduce UngleichHeaderBackgroundImageAndTextSliderPlugin that allows to have scrolling images and texts * [cms] Remove

    tag for ungleich cms customer item template