File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 11
11
from .prop_classes import DeferredProp , IgnoreOnFirstLoadProp , MergeableProp
12
12
from .settings import settings
13
13
14
-
15
14
INERTIA_REQUEST_ENCRYPT_HISTORY = "_inertia_encrypt_history"
16
15
INERTIA_SESSION_CLEAR_HISTORY = "_inertia_clear_history"
17
16
21
20
22
21
class InertiaRequest (HttpRequest ):
23
22
def __init__ (self , request ):
24
- self .request = request
25
-
26
- def __getattr__ (self , name ):
27
- return getattr (self .request , name )
23
+ super ().__init__ ()
24
+ self .__dict__ .update (request .__dict__ )
28
25
29
26
@property
30
27
def headers (self ):
31
- return self . request .headers
28
+ return super () .headers
32
29
33
30
@property
34
31
def inertia (self ):
35
- return self .request .inertia .all () if hasattr (self .request , "inertia" ) else {}
32
+ inertia_attr = self .__dict__ .get ("inertia" )
33
+ return (
34
+ inertia_attr .all () if inertia_attr and hasattr (inertia_attr , "all" ) else {}
35
+ )
36
36
37
37
def is_a_partial_render (self , component ):
38
38
return (
@@ -52,7 +52,7 @@ def is_inertia(self):
52
52
def should_encrypt_history (self ):
53
53
return validate_type (
54
54
getattr (
55
- self . request ,
55
+ self ,
56
56
INERTIA_REQUEST_ENCRYPT_HISTORY ,
57
57
settings .INERTIA_ENCRYPT_HISTORY ,
58
58
),
You can’t perform that action at this time.
0 commit comments