From 60260ccb0811299616c08e37c50ab922767cabdb Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Jun 2018 09:06:28 +0200 Subject: [PATCH 1/2] Attempt to fix flake8 error --- datacenterlight/cms_models.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py index 8c31696f..62a7b312 100644 --- a/datacenterlight/cms_models.py +++ b/datacenterlight/cms_models.py @@ -3,6 +3,7 @@ from cms.extensions.extension_pool import extension_pool from cms.models.fields import PlaceholderField from cms.models.pluginmodel import CMSPlugin from django import forms +from django.conf import settings from django.contrib.postgres.fields import ArrayField from django.contrib.sites.models import Site from django.db import models @@ -300,15 +301,17 @@ class MultipleChoiceArrayField(ArrayField): Uses Django's Postgres ArrayField and a MultipleChoiceField for its formfield. """ - VMTemplateChoices = list( - ( - str(obj.opennebula_vm_template_id), - (obj.name + ' - ' + VMTemplate.IPV6.title() - if obj.vm_type == VMTemplate.IPV6 else obj.name + VMTemplateChoices = [] + if settings.OPENNEBULA_DOMAIN != 'test_domain': + VMTemplateChoices = list( + ( + str(obj.opennebula_vm_template_id), + (obj.name + ' - ' + VMTemplate.IPV6.title() + if obj.vm_type == VMTemplate.IPV6 else obj.name + ) ) - ) - for obj in VMTemplate.objects.all() - ) + for obj in VMTemplate.objects.all() + ) def formfield(self, **kwargs): defaults = { From 88f0d733365f68db9ba8ec1274125251548bef73 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Jun 2018 09:21:41 +0200 Subject: [PATCH 2/2] Update Changelog --- Changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog b/Changelog index d175a734..d616964f 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +Next: + * bugfix: Fix flake8 error that was ignored in release 1.9.1 1.9.1: 2018-06-24 * #4799: [dcl] Show selected vm templates only in calculator (PR #638) * #4847: [comic] Add google analytics code for comic.ungleich.ch (PR #639)