Example #1
0
def minhas_bandas():
    current_user = get_current_user()
    bands = random_top_bands(user=current_user)
    bands_user = get_user_bands(user=current_user)

    resp = make_response(render_template('minhas_bandas.html', current_user=current_user, bands=bands, bands_user=bands_user))
    set_cookie_login(resp, oauth_token=get_facebook_oauth_token()[0])
    return resp
Example #2
0
def minhas_bandas():
    current_user = get_current_user()
    bands = random_top_bands(user=current_user)
    bands_user = get_user_bands(user=current_user)

    resp = make_response(
        render_template('minhas_bandas.html',
                        current_user=current_user,
                        bands=bands,
                        bands_user=bands_user))
    set_cookie_login(resp, oauth_token=get_facebook_oauth_token()[0])
    return resp
Example #3
0
def novo():
    if has_cookie_login(request) and not user_logged():
        make_login(oauth_token=get_cookie_login(request))

    current_user = get_current_user()
    current_city = current_user.city if current_user and current_user.city else "Rio de Janeiro"

    minhas_bandas_shows = []
    if current_user:
        minhas_bandas = get_user_bands(user=current_user)

        if request.args.get('band'):
            minhas_bandas.insert(0, get_band(slug=request.args.get('band')))

        minhas_bandas_shows.extend(
            get_shows_from_bands(minhas_bandas, 1, city=current_city))
    else:
        top_bands = [
            get_band("legiao-urbana"),
            get_band("the-beatles"),
            get_band("linkin-park"),
            get_band("queen"),
            get_band("guns-n-roses")
        ]

        if request.args.get('band'):
            top_bands.insert(0, get_band(slug=request.args.get('band')))

        minhas_bandas_shows = get_shows_from_bands(top_bands,
                                                   1,
                                                   city=current_city,
                                                   force_to_include_band=True)
        los_bife_band = get_band(slug="los-bife")
        minhas_bandas_shows.append((los_bife_band, los_bife_band.shows[:1]))

    return render_template("novo.html",
                           current_user=current_user,
                           minhas_bandas_shows=minhas_bandas_shows,
                           notas=range(11),
                           BANDAS_CAMISAS=BANDAS_CAMISAS,
                           formulario_pag_seguro=formulario_pag_seguro,
                           range_tamanhos=range_tamanhos)
Example #4
0
def novo():
    if has_cookie_login(request) and not user_logged():
        make_login(oauth_token=get_cookie_login(request))

    current_user = get_current_user()
    current_city = current_user.city if current_user and current_user.city else "Rio de Janeiro"

    minhas_bandas_shows = []
    if current_user:
        minhas_bandas = get_user_bands(user=current_user)

        if request.args.get('band'):
            minhas_bandas.insert(0, get_band(slug=request.args.get('band')))

        minhas_bandas_shows.extend(get_shows_from_bands(minhas_bandas, 1, city=current_city))
    else:
        top_bands = [
                        get_band("legiao-urbana"),
                        get_band("the-beatles"),
                        get_band("linkin-park"),
                        get_band("queen"),
                        get_band("guns-n-roses")
        ]

        if request.args.get('band'):
            top_bands.insert(0, get_band(slug=request.args.get('band')))

        minhas_bandas_shows = get_shows_from_bands(top_bands, 1, city=current_city, force_to_include_band=True)
        los_bife_band = get_band(slug="los-bife")
        minhas_bandas_shows.append((los_bife_band, los_bife_band.shows[:1]))



    return render_template("novo.html", current_user=current_user,
        minhas_bandas_shows=minhas_bandas_shows, notas=range(11), BANDAS_CAMISAS=BANDAS_CAMISAS,
        formulario_pag_seguro=formulario_pag_seguro, range_tamanhos=range_tamanhos)