11from collections import defaultdict
2- from zipfile import BadZipFile
32
43from flask import render_template , redirect , url_for , flash , request
54
98
109
1110@app .route ('/application/<app_id>' )
12- @auth .oidc_auth
11+ @auth .oidc_auth ( "default" )
1312@before_request
1413def get_application (app_id , info = None ):
1514 applicant_info = Applicant .query .filter_by (id = app_id ).first ()
@@ -33,7 +32,7 @@ def get_application(app_id, info=None):
3332 fields = fields )
3433
3534@app .route ('/application/content/<app_id>' )
36- @auth .oidc_auth
35+ @auth .oidc_auth ( "default" )
3736def get_application_pdf (app_id ):
3837 applicant_info = Applicant .query .filter_by (id = app_id ).first ()
3938 resp = s3 .get_object (Bucket = app .config ['S3_BUCKET_NAME' ], Key = '/' + applicant_info .rit_id + '.pdf' )
@@ -42,7 +41,7 @@ def get_application_pdf(app_id):
4241
4342
4443@app .route ('/application' , methods = ['POST' ])
45- @auth .oidc_auth
44+ @auth .oidc_auth ( "default" )
4645def create_application ():
4746 applicant_rit_id = request .form .get ('rit_id' )
4847 applicant = Applicant (
@@ -60,7 +59,7 @@ def create_application():
6059
6160
6261@app .route ('/application/import' , methods = ['POST' ])
63- @auth .oidc_auth
62+ @auth .oidc_auth ( "default" )
6463#@before_request
6564def import_application ():
6665 word_file = request .files ['file' ]
@@ -97,7 +96,7 @@ def import_application():
9796 if line [- 1 :] == ' ' :
9897 app_text += line
9998 else :
100- app_text += '\n {}' . format ( line )
99+ app_text += f '\n { line } '
101100
102101 applications [app_rit_id ] = [app_gender , app_text ]
103102 new_app = Applicant (
@@ -115,7 +114,7 @@ def import_application():
115114
116115
117116@app .route ('/application/delete/<app_id>' , methods = ['GET' ])
118- @auth .oidc_auth
117+ @auth .oidc_auth ( "default" )
119118@before_request
120119def delete_application (app_id , info = None ):
121120 is_evals = '/eboard-evaluations' in info ['group_list' ]
@@ -136,7 +135,7 @@ def delete_application(app_id, info=None):
136135
137136
138137@app .route ('/application/create' )
139- @auth .oidc_auth
138+ @auth .oidc_auth ( "default" )
140139@before_request
141140def get_application_creation (info = None ):
142141 is_evals = '/eboard-evaluations' in info ['group_list' ]
@@ -149,7 +148,7 @@ def get_application_creation(info=None):
149148
150149
151150@app .route ('/application/<app_id>' , methods = ['POST' ])
152- @auth .oidc_auth
151+ @auth .oidc_auth ( "default" )
153152@before_request
154153def submit_application (app_id , info = None ):
155154 member = Members .query .filter_by (username = info ['uid' ]).first ()
@@ -188,17 +187,17 @@ def submit_application(app_id, info=None):
188187 db .session .add (member_score )
189188 db .session .flush ()
190189 db .session .commit ()
191- flash ('Thanks for evaluating application #{}!' . format ( app_id ) )
190+ flash (f 'Thanks for evaluating application #{ app_id } !' )
192191 return redirect ('/' , 302 )
193192
194193
195194@app .route ('/application/review/<app_id>' , methods = ['GET' ])
196- @auth .oidc_auth
195+ @auth .oidc_auth ( "default" )
197196@before_request
198197def review_application (app_id , info = None ):
199198 applicant_info = Applicant .query .filter_by (id = app_id ).first ()
200199 evaluated = bool (Submission .query .filter_by (application = app_id , medium = 'Phone' ).all ())
201- scores = Submission .query .filter_by (application = app_id ).all ()
200+ scores = Submission .query .filter_by (application = app_id ).all ()
202201 return render_template (
203202 'review_app.html' ,
204203 info = info ,
@@ -209,11 +208,12 @@ def review_application(app_id, info=None):
209208
210209
211210@app .route ('/application/phone/<app_id>' , methods = ['GET' ])
212- @auth .oidc_auth
211+ @auth .oidc_auth ( "default" )
213212@before_request
214213def get_phone_application (app_id , info = None ):
215214 applicant_info = Applicant .query .filter_by (id = app_id ).first ()
216- pdf_url = s3 .generate_presigned_url ('get_object' , Params = {'Bucket' : app .config ['S3_BUCKET_NAME' ], 'Key' : applicant_info .rit_id + '.pdf' }, ExpiresIn = 30 )
215+ pdf_url = s3 .generate_presigned_url ('get_object' , Params = {'Bucket' : app .config ['S3_BUCKET_NAME' ],
216+ 'Key' : applicant_info .rit_id + '.pdf' }, ExpiresIn = 30 )
217217 pdf_url = pdf_url .replace ("s3.csh" , "assets.csh" )
218218 scores = [subs .score for subs in Submission .query .filter_by (application = app_id ).all ()]
219219 total = 0
@@ -232,7 +232,7 @@ def get_phone_application(app_id, info=None):
232232
233233
234234@app .route ('/application/phone/<app_id>' , methods = ['POST' ])
235- @auth .oidc_auth
235+ @auth .oidc_auth ( "default" )
236236@before_request
237237def promote_application (app_id , info = None ):
238238 score = request .form .get ('score' )
0 commit comments