From 74ddf70cb7410284b6405c7de29f67827388d089 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 14 May 2020 15:47:56 +0200 Subject: [PATCH] policy: add context to PolicyRequest --- passbook/policies/types.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/passbook/policies/types.py b/passbook/policies/types.py index fd549589a..1fd65e63b 100644 --- a/passbook/policies/types.py +++ b/passbook/policies/types.py @@ -1,7 +1,7 @@ """policy structures""" from __future__ import annotations -from typing import TYPE_CHECKING, Optional, Tuple +from typing import TYPE_CHECKING, Dict, Optional, Tuple from django.db.models import Model from django.http import HttpRequest @@ -16,11 +16,13 @@ class PolicyRequest: user: User http_request: Optional[HttpRequest] obj: Optional[Model] + context: Dict[str, str] def __init__(self, user: User): self.user = user self.http_request = None self.obj = None + self.context = {} def __str__(self): return f""