Commit 9f70012a authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

changed naming convention from keys to key

parent 92558c4c
......@@ -17,14 +17,14 @@ def create_app(config_name):
Bootstrap(app) # allowing app to use bootstrap
def get_authorized_user():
username_keys = list(filter(lambda key: (request.headers.get(key) is not None), vars.username_keys))
fullname_keys = list(filter(lambda key: (request.headers.get(key) is not None), vars.fullname_keys))
email_keys = list(filter(lambda key: (request.headers.get(key) is not None), vars.email_keys))
username_key = list(filter(lambda key: (request.headers.get(key) is not None), vars.username_key))
fullname_key = list(filter(lambda key: (request.headers.get(key) is not None), vars.fullname_key))
email_key = list(filter(lambda key: (request.headers.get(key) is not None), vars.email_key))
user = {
"username": (request.headers.get(username_keys[0]) if len(username_keys) > 0 else None),
"fullname": (request.headers.get(fullname_keys[0]) if len(fullname_keys) > 0 else None),
"email": (request.headers.get(email_keys[0]) if len(email_keys) > 0 else None),
"username": (request.headers.get(username_key[0]) if len(username_key) > 0 else None),
"fullname": (request.headers.get(fullname_key[0]) if len(fullname_key) > 0 else None),
"email": (request.headers.get(email_key[0]) if len(email_key) > 0 else None),
}
return user
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment