hilbert/decorators.py
def ajax_only(view_func):
    """Required the view is only accessed via AJAX."""

    @wraps(view_func, assigned=available_attrs(view_func))
    def _wrapped_view(request, *args, **kwargs):
        if request.is_ajax():
            return view_func(request, *args, **kwargs)
        else:
            return http.HttpResponseBadRequest()
    return _wrapped_view
Required the view is only accessed via AJAX.
Required the view is only accessed via AJAX.
Required the view is only accessed via AJAX .
def ajax_only(view_func):
    @wraps(view_func, assigned=available_attrs(view_func))
    def _wrapped_view(request, *args, **kwargs):
        if request.is_ajax():
            return view_func(request, *args, **kwargs)
        else:
            return http.HttpResponseBadRequest()
    return _wrapped_view
def ajax_only ( view_func ) : @ wraps ( view_func , assigned = available_attrs ( view_func ) ) def _wrapped_view ( request , * args , ** kwargs ) : if request . is_ajax ( ) : return view_func ( request , * args , ** kwargs ) else : return http . HttpResponseBadRequest ( ) return _wrapped_view
Required the view is only accessed via AJAX.
Required the view is only accessed via AJAX .
"""Required the view is only accessed via AJAX."""
view_func