<s> """<STR_LIT>""" <EOL> from django . utils import timezone <EOL> import pytz <EOL> class TimezoneMiddleware ( object ) : <EOL> """<STR_LIT>""" <EOL> def process_request ( self , request ) : <EOL> """<STR_LIT>""" <EOL> if request . user . is_authenticated ( ) : <EOL> if request . user . timezone : <EOL> timezone . activate ( pytz . timezone ( request . user . timezone ) ) </s>
