def form_validation_response(self, e):
- Method to return form validation error information.
+ Method to return form validation error information.
You will probably want to override this in your own
rm = request.method.upper()
+ if 'HTTP_X_HTTP_METHOD_OVERRIDE' in request.META:
+ rm = request.META['HTTP_X_HTTP_METHOD_OVERRIDE']
# Django's internal mechanism doesn't pick up
# PUT request, so we trick it a little here.
if not hasattr(request, 'data'):
+ if rm == 'POST' or ('HTTP_X_HTTP_METHOD_OVERRIDE' in
request.data = request.POST
request.data = request.PUT
# If we're looking at a response object which contains non-string
- # content, then assume we should use the emitter to format that
+ # content, then assume we should use the emitter to format that
status_code = result.status_code
def error_handler(self, e, request, meth, em_format):
- Override this method to add handling of errors customized for your
+ Override this method to add handling of errors customized for your
if isinstance(e, FormValidationError):
elif isinstance(e, HttpStatusCode):
On errors (like code errors), we'd like to be able to
give crash reports to both admins and also the calling