def bango_portal_from_package(request, package_id): response = _redirect_to_bango_portal(package_id, "package_id: %s" % package_id) if "Location" in response: return HttpResponseRedirect(response["Location"]) else: message = json.loads(response.content).get("__all__", response.content)[0] messages.error(request, message) return HttpResponseRedirect(reverse("lookup.home"))
def bango_portal_from_package(request, package_id): response = _redirect_to_bango_portal(package_id, 'package_id: %s' % package_id) if 'Location' in response: return HttpResponseRedirect(response['Location']) else: message = (json.loads(response.content) .get('__all__', response.content)[0]) messages.error(request, message) return HttpResponseRedirect(reverse('lookup.home'))