import flask
from flask import jsonify
from donut import app
from donut.auth_utils import get_user_id
from donut.modules.core import helpers
from donut.modules import groups

@app.route('/')
def home():
    return flask.render_template('donut.html')


@app.route('/contact')
def contact():
    return flask.render_template('contact.html')

@app.route('/campus_positions')
def campus_positions():
    approved_group_ids = []
    approved_group_names = []
    try:
        user_id = get_user_id(flask.session['username'])
        result = helpers.get_group_list_of_member(user_id) 
        for res in result:
            if res["control"] == 1:
                approved_group_ids.append(res["group_id"])
                approved_group_names.append(res["group_name"])
    except KeyError:
        print("No One is Logged In!")
    all_positions = groups.helpers.get_position_data();
    for pos in all_positions:
        pos['start_date'] = str(pos['start_date'])    
        pos['end_date'] = str(pos['end_date'])
    return flask.render_template('campus_positions.html',
        approved_group_ids=approved_group_ids, 
        approved_group_names=approved_group_names,
        all_positions=all_positions)

@@ -168,16 +168,17 @@
 groups%0A%0A
+%0A
 @app.rou
@@ -334,16 +334,17 @@
 html')%0A%0A
+%0A
 @app.rou
@@ -573,17 +573,16 @@
 user_id)
- 
 %0A       
@@ -876,9 +876,8 @@
 ta()
-;
 %0A   
@@ -953,20 +953,16 @@
 _date'%5D)
-    
 %0A       
@@ -1034,16 +1034,25 @@
 emplate(
+%0A        
 'campus_
@@ -1114,17 +1114,16 @@
 oup_ids,
- 
 %0A       

make lint