code coverage shows the case is not hit. remove noop conditional
This commit is contained in:
parent
feb8c93737
commit
59cc645b98
@ -1,17 +1,15 @@
|
|||||||
from flask import current_app, g
|
from flask import current_app
|
||||||
|
|
||||||
|
|
||||||
def get_users():
|
def get_users():
|
||||||
if 'users' not in g:
|
users = {}
|
||||||
users = {}
|
authfile = current_app.config['AUTHFILE']
|
||||||
authfile = current_app.config['AUTHFILE']
|
|
||||||
|
|
||||||
current_app.logger.debug('Reading %s for users', authfile)
|
current_app.logger.debug('Reading %s for users', authfile)
|
||||||
|
|
||||||
with current_app.open_resource(authfile) as f:
|
with current_app.open_resource(authfile) as f:
|
||||||
for entry in f:
|
for entry in f:
|
||||||
users.update({
|
users.update({
|
||||||
tuple(entry.decode('ascii').strip().split(':', 1))})
|
tuple(entry.decode('ascii').strip().split(':', 1))})
|
||||||
g.users = users
|
current_app.logger.debug(users)
|
||||||
current_app.logger.debug(g.users)
|
return users
|
||||||
return g.users
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user