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_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