<s> from __future__ import absolute_import <EOL> from flask import request , session <EOL> from freight . models import User <EOL> NOT_SET = object ( ) <EOL> def get_current_user ( ) : <EOL> """<STR_LIT>""" <EOL> if getattr ( request , '<STR_LIT>' , NOT_SET ) is NOT_SET : <EOL> if session . get ( '<STR_LIT>' ) is None : <EOL> request . current_user = None <EOL> else : <EOL> request . current_user = User . query . get ( session [ '<STR_LIT>' ] ) <EOL> if request . current_user is None : <EOL> del session [ '<STR_LIT>' ] <EOL> return request . current_user </s>
