diff --git a/pb/__init__.py b/pb/__init__.py index 3606b03..fd1426b 100644 --- a/pb/__init__.py +++ b/pb/__init__.py @@ -107,7 +107,6 @@ def load_example_sponsors(): from example_data import ExampleDataLoader ExampleDataLoader().load_sponsors() - if __name__ == '__main__': # run our standalone gevent server app.run(port=4200) diff --git a/pb/pb_mock.py b/pb/pb_mock.py index 5070b3f..09426ca 100644 --- a/pb/pb_mock.py +++ b/pb/pb_mock.py @@ -51,15 +51,16 @@ def update_selected_user(user, selected_user): return db_selected_user -def render_study_template(studies): +def render_study_template(studies, uva_id): table = StudyTable(studies) users = [] - [users.append(study.NETBADGEID) for study in studies if study.NETBADGEID not in users] + [users.append(study.NETBADGEID) for study in db.session.query(Study).all() if study.NETBADGEID not in users] return render_template( 'index.html', table=table, base_href=BASE_HREF, - users=users + users=users, + selected_user=uva_id ) def _update_study(study, form): diff --git a/pb/routes.py b/pb/routes.py index 1f530e0..0e6d821 100644 --- a/pb/routes.py +++ b/pb/routes.py @@ -36,7 +36,7 @@ def user_studies(uva_id): studies = db.session.query(Study).filter(Study.NETBADGEID == uva_id).order_by(Study.DATE_MODIFIED.desc()).all() current_user = get_current_user(request) update_selected_user(current_user, uva_id) - return render_study_template(studies) + return render_study_template(studies, uva_id) @app.route('/new_study', methods=['GET', 'POST']) diff --git a/templates/index.html b/templates/index.html index c7e8546..6297dec 100644 --- a/templates/index.html +++ b/templates/index.html @@ -20,10 +20,10 @@