def home(): season, num_week = get_season_week() games = Game.query.filter_by(week=num_week) if games is None: week = Week(num_week) week.add_games(num_week) games = Game.query.filter_by(week=num_week) update_scores()
def index(): user = current_user week = get_season_week()[1] games = Game.query.filter_by(week=week) if games is None: week = Week(week) week.add_games(num_week) games = Game.query.filter_by(week=num_week) update_scores() if current_user.is_authenticated: if current_user.confirmed: return render_template('index.html', user=user, title='Home') else: return redirect(url_for('auth.unconfirmed')) return render_template('index.html', user=user, title='Home')