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 1111from .prop_classes import DeferredProp , IgnoreOnFirstLoadProp , MergeableProp
1212from .settings import settings
1313
14-
1514INERTIA_REQUEST_ENCRYPT_HISTORY = "_inertia_encrypt_history"
1615INERTIA_SESSION_CLEAR_HISTORY = "_inertia_clear_history"
1716
2120
2221class InertiaRequest (HttpRequest ):
2322 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__ )
2825
2926 @property
3027 def headers (self ):
31- return self . request .headers
28+ return super () .headers
3229
3330 @property
3431 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+ )
3636
3737 def is_a_partial_render (self , component ):
3838 return (
@@ -52,7 +52,7 @@ def is_inertia(self):
5252 def should_encrypt_history (self ):
5353 return validate_type (
5454 getattr (
55- self . request ,
55+ self ,
5656 INERTIA_REQUEST_ENCRYPT_HISTORY ,
5757 settings .INERTIA_ENCRYPT_HISTORY ,
5858 ),
You can’t perform that action at this time.
0 commit comments