Beispiel #1
0
def reports(rid):
    if 'auth_user' in flask.session:
        uid = flask.session['auth_user']
    else:
        flask.abort(403)

    if flask.request.method == 'GET':
        if rid == 1:
            with closing(db_connect(app)) as dbc:
                report_info_1 = bug_bookmarks.get_report_info_1(dbc)
            return flask.render_template('report_1.html',
                                          report_info_1=report_info_1)
        if rid == 2:
            with closing(db_connect(app)) as dbc:
                report_info_2 = bug_bookmarks.get_report_info_2(dbc)
            return flask.render_template('report_2.html',
                                          report_info_2=report_info_2)

        if rid == 3:
            with closing(db_connect(app)) as dbc:
                report_info_3 = bug_bookmarks.get_report_info_3(dbc)
            return flask.render_template('report_3.html',
                                         report_info_3=report_info_3)
    #I do not think the 'POST' method is used
        else:
            with closing(db_connect(app)) as dbc:
                bug_bookmarks.get_bugs(dbc, uid, flask.request.form)
            return flask.redirect('/', code=303)
Beispiel #2
0
def user_profile():
    if 'auth_user' in flask.session:
        uid = flask.session['auth_user']
    else:
        flask.abort(403)

    if flask.request.method == 'GET':
        with closing(db_connect(app)) as dbc:
            user_info = bug_bookmarks.get_user_info.user_info(dbc,uid)
        return flask.render_template('user_profile.html', user_info=user_info)
    else:
        with closing(db_connect(app)) as dbc:
            bug_bookmarks.get_bugs(dbc, uid, flask.request.form)
            return flask.redirect('/', code=303)
Beispiel #3
0
def bug_list():
    if 'auth_user' in flask.session:
        uid = flask.session['auth_user']
    else:
        flask.abort(403)

    if flask.request.method == 'GET':
        with closing(db_connect(app)) as dbc:
            bugs = bug_bookmarks.get_bugs(dbc)
        return flask.render_template('bug_list.html', bugs=bugs)

    #I do not think the 'POST' method is used
    else:
        with closing(db_connect(app)) as dbc:
            bug_bookmarks.get_bugs(dbc, uid, flask.request.form)
        return flask.redirect('/', code=303)