<s> from __future__ import unicode_literals <EOL> from django import __version__ <EOL> from django . conf import settings <EOL> from shop . models . customer import CustomerModel <EOL> def customer ( request ) : <EOL> """<STR_LIT>""" <EOL> msg = "<STR_LIT>" <EOL> assert hasattr ( request , '<STR_LIT>' ) , msg <EOL> context = { <EOL> '<STR_LIT>' : request . customer , <EOL> '<STR_LIT>' : settings . SHOP_APP_LABEL . capitalize ( ) , <EOL> } <EOL> if request . user . is_staff : <EOL> try : <EOL> context . update ( customer = CustomerModel . objects . get ( pk = request . session [ '<STR_LIT>' ] ) ) <EOL> except ( CustomerModel . DoesNotExist , KeyError , AttributeError ) : <EOL> pass <EOL> return context <EOL> def version ( request ) : <EOL> """<STR_LIT>""" <EOL> return { <EOL> '<STR_LIT>' : __version__ , <EOL> } </s>
