|
@ -100,12 +100,15 @@ def set_session(): |
|
|
def can_list(): |
|
|
def can_list(): |
|
|
key = request.args.get('key') |
|
|
key = request.args.get('key') |
|
|
sort_by = request.args.get('sort_by', 'time') |
|
|
sort_by = request.args.get('sort_by', 'time') |
|
|
|
|
|
final_list = request.args.get('final_list', '') |
|
|
|
|
|
|
|
|
if 'uid' not in session: |
|
|
if 'uid' not in session: |
|
|
return redirect('set_session') |
|
|
return redirect('set_session') |
|
|
uid = session.get('uid') |
|
|
uid = session.get('uid') |
|
|
|
|
|
|
|
|
q = Candidate.query |
|
|
q = Candidate.query |
|
|
|
|
|
if final_list and C.step2.get('final_list'): |
|
|
|
|
|
q = q.filter(Candidate.id.in_(C.step2['final_list'])) |
|
|
q = q.order_by(db.desc('likeNum')) if sort_by=='likeNum' else q.order_by(db.desc('id')) |
|
|
q = q.order_by(db.desc('likeNum')) if sort_by=='likeNum' else q.order_by(db.desc('id')) |
|
|
pag = q.paginate(max_per_page=100) |
|
|
pag = q.paginate(max_per_page=100) |
|
|
|
|
|
|
|
@ -122,7 +125,7 @@ def can_list(): |
|
|
} for name, ques, hint, ans in C.verify |
|
|
} for name, ques, hint, ans in C.verify |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
return render_template('list.html', pagination=pag, vs=vs, verified=session.get('verified'), showPrivate=(key==C.key), sort_by=sort_by, key=key, base_toot_url='https://%s/web/statuses/' % C.domain, step2=C.step2, text1=C.text1, text2=C.text2) |
|
|
|
|
|
|
|
|
return render_template('list.html', pagination=pag, vs=vs, verified=session.get('verified'), showPrivate=(key==C.key), sort_by=sort_by, key=key, final_list=final_list,base_toot_url='https://%s/web/statuses/' % C.domain, step2=C.step2, text1=C.text1, text2=C.text2) |
|
|
|
|
|
|
|
|
@app.route('/ordinary/new', methods=['POST']) |
|
|
@app.route('/ordinary/new', methods=['POST']) |
|
|
@limiter.limit("5 / hour; 1 / 2 second") |
|
|
@limiter.limit("5 / hour; 1 / 2 second") |
|
|