Get the user id in flask
You could save the user_id in the app context using "g":
from flask import gif current_user.is_authenticated(): g.user = current_user.get_id()
But the simplest solution would be just to pass the user id to the function that you're calling.
# call this function from inside the app/request contextdef function_a(user_id): os.mkdir(os.path.join(path,user_id)) return 'Path created successfully'