Ejemplo n.º 1
0
def index():
    token = request.cookies.get('token')
    user_id = session.get("user_id")
    if token:
        username = User.find_name_by_id(user_id)
        return render_template('index.html',
                               advertisements=Advertisement.all(),
                               token=token,
                               username=username)
    else:
        return render_template('index.html',
                               advertisements=Advertisement.all(),
                               token=token)
Ejemplo n.º 2
0
def ads():
    current_user = User.find_by_username(session.get('username'))
    return render_template('ads.html',
                           advertisements=Advertisement.all(),
                           current_user=current_user,
                           session=session)