def process_request(self, request): """ Set the thread's pinning flag according to the presence of the session variable. """ pinned_until = request.session.get(PINNING_KEY, False) if pinned_until and pinned_until > datetime.now(): PinningMixin.pin_thread()
def process_request(self, request): """ Set the thread's pinning flag according to the presence of the cookie. """ if PINNING_KEY in request.COOKIES: PinningMixin.pin_thread()