예제 #1
0
def new_alerts():
    """Return a simple http status  response to denote if the current user has
    any alerts since last time this was called.

    This will be passed in with the template but will allow something an AJAX
    call to get the data also.

    .. note: See ``pjuu/static/js/alerts.js``
    """
    # We don't want this view to redirect to signin so we will throw a 403
    # this will make jQuery easier to use with this endpoint
    if not current_user:
        return abort(403)

    uid = current_user.get('_id')

    # If a user has alerts then return a 200 else a 404
    return jsonify({'new_alerts': be_new_alerts(uid)})
예제 #2
0
파일: views.py 프로젝트: pjuu/pjuu
def new_alerts():
    """Return a simple http status  response to denote if the current user has
    any alerts since last time this was called.

    This will be passed in with the template but will allow something an AJAX
    call to get the data also.

    .. note: See ``pjuu/static/js/alerts.js``
    """
    # We don't want this view to redirect to signin so we will throw a 403
    # this will make jQuery easier to use with this endpoint
    if not current_user:
        return abort(403)

    uid = current_user.get('_id')

    # If a user has alerts then return a 200 else a 404
    return jsonify({'new_alerts': be_new_alerts(uid)})
예제 #3
0
파일: views.py 프로젝트: hnk/pjuu
def new_alerts_filter(user_id):
    """Check to see if the user has any alerts.

    .. warning: Should only ever really be used with ``current_user``.
    """
    return be_new_alerts(user_id)
예제 #4
0
def new_alerts_filter(user_id):
    """Check to see if the user has any alerts.

    .. warning: Should only ever really be used with ``current_user``.
    """
    return be_new_alerts(user_id)