Merge "Cache getting package name"

This commit is contained in:
Jenkins 2015-03-19 13:27:39 +00:00 committed by Gerrit Code Review
commit cf0f4c1980
3 changed files with 8 additions and 8 deletions

View File

@ -103,7 +103,13 @@ def get_app_supplier_logo(request, app_id):
return api.muranoclient(request).packages.get_supplier_logo(app_id)
@cache.with_cache('package')
@cache.with_cache('package_fqn')
def get_app_fqn(request, app_id):
package = api.muranoclient(request).packages.get(app_id)
return package.fully_qualified_name
@cache.with_cache('package_name')
def get_service_name(request, app_id):
package = api.muranoclient(request).packages.get(app_id)
return package.name

View File

@ -303,7 +303,7 @@ class Wizard(views.ModalFormMixin, LazyWizard):
def done(self, form_list, **kwargs):
app_id = kwargs['app_id']
app_name = services.get_service_name(self.request, app_id)
app_name = pkg_api.get_service_name(self.request, app_id)
service = form_list[0].service
attributes = service.extract_attributes()

View File

@ -20,7 +20,6 @@ import yaql
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from muranodashboard import api
from muranodashboard.api import packages as pkg_api
from muranodashboard.catalog import forms as catalog_forms
from muranodashboard.dynamic_ui import helpers
@ -189,11 +188,6 @@ def service_type_from_id(service_id):
return service_id
def get_service_name(request, app_id):
package = api.muranoclient(request).packages.get(app_id)
return package.name
def get_app_field_descriptions(request, app_id, index):
app = import_app(request, app_id)