1+ # pylint: disable=wrong-import-order
2+ from ._version import __version__
3+
14import os
25import subprocess
36from datetime import datetime
47
5- import structlog
68from csh_ldap import CSHLDAP
79from flask import Flask , redirect , render_template , g
810from flask_migrate import Migrate
911from flask_pyoidc .flask_pyoidc import OIDCAuthentication
1012from flask_sqlalchemy import SQLAlchemy
1113from raven .contrib .flask import Sentry
14+ import structlog
15+
16+ from conditional import config
1217
1318app = Flask (__name__ )
1419
15- config = os .path .join (app .config .get ('ROOT_DIR' , os .getcwd ()), "config.py" )
20+ app .config .from_object (config )
21+ if os .path .exists (os .path .join (os .getcwd (), "config.py" )):
22+ app .config .from_pyfile (os .path .join (os .getcwd (), "config.py" ))
1623
17- app .config .from_pyfile (config )
1824app .config ["SQLALCHEMY_TRACK_MODIFICATIONS" ] = False
1925
2026app .config ["GIT_REVISION" ] = subprocess .check_output (['git' ,
3541
3642app .secret_key = app .config ["SECRET_KEY" ]
3743
44+
3845def start_of_year ():
3946 start = datetime (datetime .today ().year , 6 , 1 )
4047 if datetime .today () < start :
@@ -43,7 +50,7 @@ def start_of_year():
4350
4451
4552# pylint: disable=C0413
46- from conditional .models .models import UserLog
53+ from .models .models import UserLog
4754
4855
4956# Configure Logging
@@ -86,19 +93,19 @@ def database_processor(logger, log_method, event_dict): # pylint: disable=unuse
8693
8794from conditional .util .auth import get_user
8895
89- from conditional .blueprints .dashboard import dashboard_bp # pylint: disable=ungrouped-imports
90- from conditional .blueprints .attendance import attendance_bp
91- from conditional .blueprints .major_project_submission import major_project_bp
92- from conditional .blueprints .intro_evals import intro_evals_bp
93- from conditional .blueprints .intro_evals_form import intro_evals_form_bp
94- from conditional .blueprints .housing import housing_bp
95- from conditional .blueprints .spring_evals import spring_evals_bp
96- from conditional .blueprints .conditional import conditionals_bp
97- from conditional .blueprints .member_management import member_management_bp
98- from conditional .blueprints .slideshow import slideshow_bp
99- from conditional .blueprints .cache_management import cache_bp
100- from conditional .blueprints .co_op import co_op_bp
101- from conditional .blueprints .logs import log_bp
96+ from .blueprints .dashboard import dashboard_bp # pylint: disable=ungrouped-imports
97+ from .blueprints .attendance import attendance_bp
98+ from .blueprints .major_project_submission import major_project_bp
99+ from .blueprints .intro_evals import intro_evals_bp
100+ from .blueprints .intro_evals_form import intro_evals_form_bp
101+ from .blueprints .housing import housing_bp
102+ from .blueprints .spring_evals import spring_evals_bp
103+ from .blueprints .conditional import conditionals_bp
104+ from .blueprints .member_management import member_management_bp
105+ from .blueprints .slideshow import slideshow_bp
106+ from .blueprints .cache_management import cache_bp
107+ from .blueprints .co_op import co_op_bp
108+ from .blueprints .logs import log_bp
102109
103110app .register_blueprint (dashboard_bp )
104111app .register_blueprint (attendance_bp )
@@ -114,7 +121,7 @@ def database_processor(logger, log_method, event_dict): # pylint: disable=unuse
114121app .register_blueprint (co_op_bp )
115122app .register_blueprint (log_bp )
116123
117- from conditional .util .ldap import ldap_get_member
124+ from .util .ldap import ldap_get_member
118125
119126
120127@app .route ('/<path:path>' )
0 commit comments