From e44afd05955301ca8e7f37d07d9c3d8726abb46b Mon Sep 17 00:00:00 2001 From: Ekaterina Fedorova Date: Fri, 14 Jun 2013 13:59:00 +0400 Subject: [PATCH] Fix datun_id exception Change-Id: Ifaf626de60c6f3722e49df60851efc348b1c64ce --- muranodashboard/panel/api.py | 2 +- muranodashboard/panel/forms.py | 2 +- muranodashboard/panel/tabs.py | 14 ++++++-------- muranodashboard/panel/views.py | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/muranodashboard/panel/api.py b/muranodashboard/panel/api.py index 28f960a65..e88758e93 100644 --- a/muranodashboard/panel/api.py +++ b/muranodashboard/panel/api.py @@ -227,7 +227,7 @@ def service_get(request, environment_id, service_id): if instance: service_data = instance[0] if service_data['id'] == service_id: - return service_data + return bunch.bunchify(service_data) def check_for_services(request, environment_id): diff --git a/muranodashboard/panel/forms.py b/muranodashboard/panel/forms.py index 6c28af215..49e815506 100644 --- a/muranodashboard/panel/forms.py +++ b/muranodashboard/panel/forms.py @@ -76,7 +76,7 @@ class CommonPropertiesExtension(object): class WizardFormADConfiguration(forms.Form, CommonPropertiesExtension): domain_name_re = re.compile( - r'^[a-zA-Z0-9][a-zA-Z0-9.-]+[a-zA-Z0-9]$') + r'^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9]$') validate_domain_name = RegexValidator(domain_name_re, _(u'Enter a valid domain name: \ just letters, numbers, dashes and \ diff --git a/muranodashboard/panel/tabs.py b/muranodashboard/panel/tabs.py index d8f3ad366..68acf74bc 100644 --- a/muranodashboard/panel/tabs.py +++ b/muranodashboard/panel/tabs.py @@ -32,20 +32,18 @@ class OverviewTab(tabs.Tab): service_data = self.tab_group.kwargs['service'] for id, name in STATUS_DISPLAY_CHOICES: - if id == service_data[u'status']: + if id == service_data.status: status_name = name - detail_info = {'service_name': service_data[u'name'], + detail_info = {'service_name': service_data.name, 'service_status': status_name, - 'service_type': service_data[u'service_type']} + 'service_type': service_data.service_type} - if not service_data[u'domain']: + if not service_data.domain: detail_info['service_domain'] = 'Not in domain' - uri = service_data.get(u'uri') - if uri: - detail_info[u'uri'] = service_data[u'uri'] - + if hasattr(service_data, 'uri'): + detail_info["uri"] = service_data.uri return detail_info diff --git a/muranodashboard/panel/views.py b/muranodashboard/panel/views.py index fce3d5285..f26874fa4 100644 --- a/muranodashboard/panel/views.py +++ b/muranodashboard/panel/views.py @@ -211,7 +211,7 @@ class DetailServiceView(tabs.TabView): def get_context_data(self, **kwargs): context = super(DetailServiceView, self).get_context_data(**kwargs) context["service"] = self.get_data() - context["service_name"] = self.service.get(u'name') + context["service_name"] = self.service.name return context def get_data(self):