<s> from __future__ import absolute_import <EOL> from django . contrib . auth import SESSION_KEY , get_user_model <EOL> def get_session_dict_user ( session_dict ) : <EOL> try : <EOL> return get_user_model ( ) . _meta . pk . to_python ( session_dict [ SESSION_KEY ] ) <EOL> except KeyError : <EOL> return None <EOL> def get_session_user ( session ) : <EOL> return get_session_dict_user ( session . get_decoded ( ) ) </s>
