Exemplo 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}
Exemplo 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}
Exemplo n.º 3
0
 def get_data(self, request, image_id):
     image = api.image_detail(request, image_id)
     return image
Exemplo n.º 4
0
 def get_data(self, request, image_id):
     image = api.image_detail(request, image_id)
     return image