Commits

Luke Plant  committed f110e91

Made pickling of responses more robust.

  • Participants
  • Parent commits b73d60d

Comments (0)

Files changed (1)

File output_validator/models.py

             failure.errors = errors
 
             failure.request = repr(request)
-            failure.response = base64.encodestring(cPickle.dumps(response))
+            try:
+                failure.response = base64.encodestring(cPickle.dumps(response))
+            except Exception:
+                # Just get the content
+                failure.response = base64.encodestring(cPickle.dumps({'content':response.content}))
+
             failure.method = request.META['REQUEST_METHOD']
             failure.save()
     do_validation = staticmethod(do_validation)