File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 18
18
from rest_framework import HTTP_HEADER_ENCODING
19
19
from rest_framework import exceptions
20
20
from rest_framework .settings import api_settings
21
+ import sys
21
22
import warnings
22
23
23
24
@@ -485,8 +486,16 @@ def _not_authenticated(self):
485
486
else :
486
487
self .auth = None
487
488
488
- def __getattr__ (self , attr ):
489
+ def __getattribute__ (self , attr ):
489
490
"""
490
- Proxy other attributes to the underlying HttpRequest object.
491
+ If an attribute does not exist on this instance, then we also attempt
492
+ to proxy it to the underlying HttpRequest object.
491
493
"""
492
- return getattr (self ._request , attr )
494
+ try :
495
+ return super (Request , self ).__getattribute__ (attr )
496
+ except AttributeError :
497
+ info = sys .exc_info ()
498
+ try :
499
+ return getattr (self ._request , attr )
500
+ except AttributeError :
501
+ raise info [0 ], info [1 ], info [2 ].tb_next
You can’t perform that action at this time.
0 commit comments