@@ -217,7 +217,8 @@ def query_params(self):
217
217
@property
218
218
def data (self ):
219
219
if not _hasattr (self , '_full_data' ):
220
- self ._load_data_and_files ()
220
+ with wrap_attributeerrors ():
221
+ self ._load_data_and_files ()
221
222
return self ._full_data
222
223
223
224
@property
@@ -420,13 +421,14 @@ def __getattr__(self, attr):
420
421
_request = self .__getattribute__ ("_request" )
421
422
return getattr (_request , attr )
422
423
except AttributeError :
423
- return self .__getattribute__ ( attr )
424
+ raise AttributeError ( f"' { self .__class__ . __name__ } ' object has no attribute ' { attr } '" )
424
425
425
426
@property
426
427
def POST (self ):
427
428
# Ensure that request.POST uses our request parsing.
428
429
if not _hasattr (self , '_data' ):
429
- self ._load_data_and_files ()
430
+ with wrap_attributeerrors ():
431
+ self ._load_data_and_files ()
430
432
if is_form_media_type (self .content_type ):
431
433
return self ._data
432
434
return QueryDict ('' , encoding = self ._request ._encoding )
@@ -437,7 +439,8 @@ def FILES(self):
437
439
# Different from the other two cases, which are not valid property
438
440
# names on the WSGIRequest class.
439
441
if not _hasattr (self , '_files' ):
440
- self ._load_data_and_files ()
442
+ with wrap_attributeerrors ():
443
+ self ._load_data_and_files ()
441
444
return self ._files
442
445
443
446
def force_plaintext_errors (self , value ):
0 commit comments