Esempio n. 1
0
def home():
    photos = get_last_photos(session['user']['nick'])
    users = get_users()
    return render_template('home.html',
                           photos=photos,
                           bucket=Config.S3_BUCKET_NAME,
                           error=None,
                           users=users)
Esempio n. 2
0
def find_user(nick):
    u = find_by_nick(nick)
    photos = get_photo_by_user(u.nick)
    users = get_users()
    return render_template('home.html',
                           photos=photos,
                           bucket=Config.S3_BUCKET_NAME,
                           error=None,
                           visited_user=u)
Esempio n. 3
0
def date_filter():
    start = datetime.fromtimestamp(
        mktime(strptime(request.form['start'], "%d/%m/%Y")))
    end = datetime.fromtimestamp(
        mktime(strptime(request.form['end'], "%d/%m/%Y")))

    if start < end:
        photos = get_last_photos(session['user']['nick'], start, end)
        users = get_users()
        return render_template('home.html',
                               photos=photos,
                               bucket=Config.S3_BUCKET_NAME,
                               error=None,
                               users=users)
    else:
        flash(messages.INVALID_DATE_FILTER)
        return redirect(url_for("home_api.home"))
Esempio n. 4
0
def resolve_get_users(*_):
    return get_users()
Esempio n. 5
0
def all(db: Session = Depends(get_db)):
    return get_users(db)