Esempio n. 1
0
 def get_context_data(self, request):
     image_id = self.tab_group.kwargs['image_id']
     try:
         image = api.image_detail(request,image_id)
         image['shortDescription'] = striphtml(image['shortDescription'])
         image['detailedDescription'] = striphtml(image['detailedDescription'])
     except Exception:
         redirect = reverse('horizon:cnext:images:index')
         exceptions.handle(request,
                           _('Unable to retrieve image details.'),
                           redirect=redirect)
     return {'image': image}
Esempio n. 2
0
 def get_context_data(self, request):
     image_id = self.tab_group.kwargs['image_id']
     try:
         image = api.image_detail(request, image_id)
         image['shortDescription'] = striphtml(image['shortDescription'])
         image['detailedDescription'] = striphtml(
             image['detailedDescription'])
     except Exception:
         redirect = reverse('horizon:cnext:images:index')
         exceptions.handle(request,
                           _('Unable to retrieve image details.'),
                           redirect=redirect)
     return {'image': image}
 def get_data(self, request, image_id):
     image = api.image_detail(request, image_id)
     return image
 def get_data(self, request, image_id):
     image = api.image_detail(request, image_id)
     return image