@@ -81,7 +81,7 @@ def home(page, auth_dict=None):
8181 db_files = File .query .offset ((page - 1 ) * 10 ).limit (10 ).all ()
8282 harolds = get_harold_list (auth_dict ["uid" ])
8383 tour_harolds = get_harold_list ("root" )
84-
84+
8585 is_rtp = ldap_is_rtp (auth_dict ["uid" ])
8686 is_eboard = ldap_is_eboard (auth_dict ["uid" ])
8787
@@ -144,7 +144,7 @@ def selected(page, auth_dict=None):
144144
145145 is_rtp = ldap_is_rtp (auth_dict ["uid" ])
146146 is_eboard = ldap_is_eboard (auth_dict ["uid" ])
147-
147+
148148 tour_harolds = get_harold_list ("root" )
149149 db_files = query .offset ((page - 1 ) * 10 ).limit (10 ).all ()
150150 return render_template ("main.html" , db_files = db_files ,
@@ -164,18 +164,19 @@ def admin_def(auth_dict=None):
164164@auth .oidc_auth ('default' )
165165@audiophiler_auth
166166def admin (page , auth_dict = None ):
167+ tour_harolds = get_harold_list ("root" )
167168 query = File .query .filter (File .file_hash .in_ (tour_harolds ))
168169 rows = query .count ()
170+ rows = int (rows // 10 + bool (rows % 10 ))
169171
170172 if page > rows or page < 1 :
171173 return "Page Out of Bounds" , 404
172174
173- rows = int (rows // 10 + bool (rows % 10 ))
174175 is_rtp = ldap_is_rtp (auth_dict ["uid" ])
175176 is_eboard = ldap_is_eboard (auth_dict ["uid" ])
177+
176178 if is_eboard or is_rtp :
177- harolds = get_harold_list (auth_dict ["uid" ])
178- tour_harolds = get_harold_list ("root" )
179+ harolds = get_harold_list (auth_dict ["uid" ])
179180 db_files = query .offset ((page - 1 ) * 10 ).limit (10 ).all ()
180181 return render_template ("main.html" , db_files = db_files ,
181182 get_date_modified = get_date_modified , s3_bucket = s3_bucket ,
0 commit comments