Let AUTHFILE be absolute path

This commit is contained in:
2022-03-14 15:20:49 +01:00
parent 27bc683f8f
commit feb8c93737
2 changed files with 4 additions and 5 deletions

View File

@ -1,5 +1,4 @@
from flask import current_app, g
import os
def get_users():
@ -9,10 +8,10 @@ def get_users():
current_app.logger.debug('Reading %s for users', authfile)
with current_app.open_resource(os.path.join("..",
authfile)) as f:
with current_app.open_resource(authfile) as f:
for entry in f:
users.update({tuple(entry.decode('ascii').strip().split(':', 1))})
users.update({
tuple(entry.decode('ascii').strip().split(':', 1))})
g.users = users
current_app.logger.debug(g.users)
return g.users