def process_response(self, request, response):
        content_type = response.get('content-type')
        try:
            if content_type.startswith('text/html'):
                # only update last_access when rendering the main page
                request.customer.last_access = timezone.now()
                request.customer.save(update_fields=['last_access'])
        except __HOLE__:
            pass
        return response
dataset/ETHPy150Open awesto/django-shop/shop/middleware.py/CustomerMiddleware.process_response