77from werkzeug .middleware .proxy_fix import ProxyFix
88
99from webapp .cache import init_cache
10- from webapp .celery import init_celery
1110from webapp .context import RegexConverter , base_context , clear_trailing_slash
1211from webapp .gdrive import init_gdrive
12+ from webapp .github import init_github
1313from webapp .jira import init_jira
1414from webapp .models import init_db
1515from webapp .sso import init_sso
@@ -47,8 +47,8 @@ def create_app():
4747 # Initialize gdrive
4848 init_gdrive (app )
4949
50- # Initialize celery
51- init_celery (app )
50+ # Initialize github
51+ init_github (app )
5252
5353 return app
5454
@@ -67,7 +67,8 @@ def set_security_headers(response):
6767 if flask .request .endpoint in flask .current_app .view_functions :
6868 view_func = flask .current_app .view_functions [flask .request .endpoint ]
6969 add_xframe_options_header = not hasattr (
70- view_func , "_exclude_xframe_options_header"
70+ view_func ,
71+ "_exclude_xframe_options_header" ,
7172 )
7273
7374 if add_xframe_options_header and "X-Frame-Options" not in response .headers :
@@ -106,10 +107,14 @@ def set_cache_control_headers(response):
106107
107108 max_age = response .cache_control .max_age
108109 stale_while_revalidate = response .cache_control ._get_cache_value (
109- "stale-while-revalidate" , False , int
110+ "stale-while-revalidate" ,
111+ False ,
112+ int ,
110113 )
111114 stale_if_error = response .cache_control ._get_cache_value (
112- "stale-if-error" , False , int
115+ "stale-if-error" ,
116+ False ,
117+ int ,
113118 )
114119
115120 if type (max_age ) is not int :
@@ -142,7 +147,9 @@ def set_cache_control_headers(response):
142147 #
143148 # An additional day will hopefully be long enough for most cases.
144149 response .cache_control ._set_cache_value (
145- "stale-while-revalidate" , "86400" , int
150+ "stale-while-revalidate" ,
151+ "86400" ,
152+ int ,
146153 )
147154
148155 if type (stale_if_error ) is not int :
@@ -164,7 +171,9 @@ def set_cache_control_headers(response):
164171 #
165172 # So we set this to 5 minutes following expiry as a trade-off.
166173 response .cache_control ._set_cache_value (
167- "stale-if-error" , "300" , int
174+ "stale-if-error" ,
175+ "300" ,
176+ int ,
168177 )
169178
170179 return response
@@ -267,7 +276,8 @@ def __init__(
267276 def not_found_error (error ):
268277 return (
269278 flask .render_template (
270- template_404 , message = error .description
279+ template_404 ,
280+ message = error .description ,
271281 ),
272282 404 ,
273283 )
@@ -278,7 +288,8 @@ def not_found_error(error):
278288 def internal_error (error ):
279289 return (
280290 flask .render_template (
281- template_500 , message = error .description
291+ template_500 ,
292+ message = error .description ,
282293 ),
283294 500 ,
284295 )
@@ -294,7 +305,8 @@ def status_check():
294305 @self .route ("/favicon.ico" )
295306 def favicon ():
296307 return flask .send_file (
297- favicon_path , mimetype = "image/vnd.microsoft.icon"
308+ favicon_path ,
309+ mimetype = "image/vnd.microsoft.icon" ,
298310 )
299311
300312 elif favicon_url :
0 commit comments