Skip to content

Commit 13d2fb6

Browse files
committed
Style Fixes
1 parent d214bdf commit 13d2fb6

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

conditional/__init__.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
'--short',
2323
'HEAD']).decode('utf-8').rstrip()
2424

25-
2625
db = SQLAlchemy(app)
2726
migrate = Migrate(app, db)
2827
sentry = Sentry(app)
@@ -39,12 +38,14 @@
3938
def start_of_year():
4039
start = datetime(datetime.today().year, 6, 1)
4140
if datetime.today() < start:
42-
start = datetime(datetime.today().year-1, 6, 1)
41+
start = datetime(datetime.today().year - 1, 6, 1)
4342
return start
4443

44+
4545
# pylint: disable=C0413
4646
from conditional.models.models import UserLog
4747

48+
4849
# Configure Logging
4950
def request_processor(logger, log_method, event_dict): # pylint: disable=unused-argument, redefined-outer-name
5051
if 'request' in event_dict:
@@ -67,18 +68,19 @@ def database_processor(logger, log_method, event_dict): # pylint: disable=unuse
6768
blueprint=event_dict['blueprint'],
6869
path=event_dict['path'],
6970
description=event_dict['event']
70-
)
71+
)
7172
db.session.add(log)
7273
db.session.flush()
7374
db.session.commit()
7475
del event_dict['request']
7576
return event_dict
7677

78+
7779
structlog.configure(processors=[
7880
request_processor,
7981
database_processor,
8082
structlog.processors.KeyValueRenderer()
81-
])
83+
])
8284

8385
logger = structlog.get_logger()
8486

@@ -114,6 +116,7 @@ def database_processor(logger, log_method, event_dict): # pylint: disable=unuse
114116

115117
from conditional.util.ldap import ldap_get_member
116118

119+
117120
@app.route('/<path:path>')
118121
def static_proxy(path):
119122
# send_static_file will guess the correct MIME type
@@ -164,15 +167,17 @@ def route_errors(error, username=None):
164167
error_desc = type(error).__name__
165168

166169
return render_template('errors.html',
167-
error=error_desc,
168-
error_code=code,
169-
event_id=g.sentry_event_id,
170-
public_dsn=sentry.client.get_public_dsn('https'),
171-
**data), int(code)
170+
error=error_desc,
171+
error_code=code,
172+
event_id=g.sentry_event_id,
173+
public_dsn=sentry.client.get_public_dsn('https'),
174+
**data), int(code)
175+
172176

173177
@app.cli.command()
174178
def zoo():
175179
from conditional.models.migrate import free_the_zoo
176180
free_the_zoo(app.config['ZOO_DATABASE_URI'])
177181

182+
178183
logger.info('conditional started')

0 commit comments

Comments
 (0)