def get_current_user():
thread_local = AutomatedLoggingMiddleware.thread_local<EOL>if hasattr(thread_local, '<STR_LIT>'):<EOL><INDENT>user = thread_local.current_user<EOL>if isinstance(user, AnonymousUser):<EOL><INDENT>user = None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>user = None<EOL><DEDENT>return user<EOL>
Get current user object from middleware