0002-decorators-add-SessionCache-to-store-cache-of-values.patch
src/authentic2/decorators.py | ||
---|---|---|
217 | 217 |
if self.get(key) == value: |
218 | 218 |
self.delete(key) |
219 | 219 | |
220 | ||
221 |
class SessionCache(SimpleDictionnaryCacheMixin, CacheDecoratorBase): |
|
222 |
@property |
|
223 |
def cache(self): |
|
224 |
request = middleware.StoreRequestMiddleware.get_request() |
|
225 |
if not request: |
|
226 |
return {} |
|
227 |
# create a cache dictionary on the request |
|
228 |
return request.session.setdefault(self.__class__.__name__, {}) |
|
229 | ||
230 | ||
220 | 231 |
@contextmanager |
221 | 232 |
def errorcollector(error_dict): |
222 | 233 |
try: |
223 |
- |