def index(request): hue_collections = SearchController(request.user).get_search_collections() collection_id = request.GET.get('collection') if not hue_collections or not collection_id: return admin_collections(request, True) try: collection = hue_collections.get(id=collection_id) except Exception, e: raise PopupException(e, title=_("Dashboard does not exist or you don't have the permission to access it."))