-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up, add docstrings, remove commented out stuff.
- Loading branch information
Showing
8 changed files
with
33 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
""" Routes related to the time-entry and competition results pages. """ | ||
|
||
from flask import render_template, abort | ||
|
||
from app import CUBERS_APP | ||
from app.persistence import comp_manager | ||
|
||
from flask import render_template | ||
from flask_login import current_user | ||
|
||
import sys | ||
# ------------------------------------------------------------------------------------------------- | ||
|
||
@CUBERS_APP.route('/') | ||
def index(): | ||
""" Main page for the app. Shows the competition time entry page if logged in, or an informative | ||
landing page if not. """ | ||
#if current_user.is_authenticated: | ||
#return render_template('comp.html') | ||
return render_template('index.html', current_competition = comp_manager.get_active_competition()) | ||
|
||
competition = comp_manager.get_active_competition() | ||
return render_template('index.html', current_competition = competition) | ||
|
||
|
||
@CUBERS_APP.route('/comp/<competition_id>') | ||
def competition(competition_id): | ||
try: | ||
competition_id = int(competition_id) | ||
except ValueError: | ||
print("Invalid competition_id", file=sys.stderr) | ||
|
||
return render_template('comp.html', competition = comp_manager.get_competition(competition_id)) | ||
# TODO: come up with custom 404 not found page | ||
return abort(404) | ||
|
||
return render_template('comp.html', competition = comp_manager.get_competition(competition_id)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters