def _load_form_data(self): BaseRequest._load_form_data(self) if (self.debug and self.mimetype != 'multipart/form-data' and not self.files): from .debughelpers import attach_enctype_error_multidict attach_enctype_error_multidict(self)
def _load_form_data(self): RequestBase._load_form_data(self) # in debug mode we're replacing the files multidict with an ad-hoc # subclass that raises a different error for key errors. ctx = _request_ctx_stack.top if ctx is not None and ctx.app.debug and self.mimetype != "multipart/form-data" and not self.files: attach_enctype_error_multidict(self)
def _load_form_data(self): RequestBase._load_form_data(self) # in debug mode we're replacing the files multidict with an ad-hoc # subclass that raises a different error for key errors. ctx = _request_ctx_stack.top if ctx is not None and ctx.app.debug and \ self.mimetype != 'multipart/form-data' and not self.files: attach_enctype_error_multidict(self)
def _load_form_data(self): RequestBase._load_form_data(self) # In debug mode we're replacing the files multidict with an ad-hoc # subclass that raises a different error for key errors. if (current_app and current_app.debug and self.mimetype != 'multipart/form-data' and not self.files): from .debughelpers import attach_enctype_error_multidict attach_enctype_error_multidict(self)
def _load_form_data(self): # 这个方法用于加载表单或者是文件数据 RequestBase._load_form_data(self) # In debug mode we're replacing the files multidict with an ad-hoc # subclass that raises a different error for key errors. # 如果在测试环境下,请求头不是multipart/form-data或者是不带文件的话,进行错误处理 if (current_app and current_app.debug and self.mimetype != "multipart/form-data" and not self.files): from .debughelpers import attach_enctype_error_multidict attach_enctype_error_multidict(self)
def _load_form_data(self): RequestBase._load_form_data(self) # In debug mode we're replacing the files multidict with an ad-hoc # subclass that raises a different error for key errors. if ( current_app and current_app.debug and self.mimetype != 'multipart/form-data' and not self.files ): from .debughelpers import attach_enctype_error_multidict attach_enctype_error_multidict(self)