From e522789c17d35b5bf588d704e37bf01e7114b640 Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Sat, 23 Jan 2016 21:33:23 +0000 Subject: [PATCH 1/3] Cover case of 500 --- .../static/rest_framework_docs/js/components/response.js | 2 +- rest_framework_docs/static/rest_framework_docs/js/dist.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rest_framework_docs/static/rest_framework_docs/js/components/response.js b/rest_framework_docs/static/rest_framework_docs/js/components/response.js index af4192b..130e635 100644 --- a/rest_framework_docs/static/rest_framework_docs/js/components/response.js +++ b/rest_framework_docs/static/rest_framework_docs/js/components/response.js @@ -31,7 +31,7 @@ var Response = React.createClass({ } var responseJSON = JSONpp.prettyPrint(this.state.payload.body); - var hasToken = this.state.payload.body.hasOwnProperty('token'); + var hasToken = this.state.payload.body ? this.state.payload.body.hasOwnProperty('token') : false; var statusText = this.state.payload.statusText.toLowerCase(); var statusCodeFirstChar = String(this.state.payload.status).charAt(0); var statusCodeClass = 'label status-code pull-right status-code-' + statusCodeFirstChar; diff --git a/rest_framework_docs/static/rest_framework_docs/js/dist.min.js b/rest_framework_docs/static/rest_framework_docs/js/dist.min.js index 6846efc..3149c23 100644 --- a/rest_framework_docs/static/rest_framework_docs/js/dist.min.js +++ b/rest_framework_docs/static/rest_framework_docs/js/dist.min.js @@ -9,4 +9,4 @@ n===o?a=o.props:(a=this._processProps(o.props),s.componentWillReceiveProps&&s.co "production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?Y(null==n.innerHTML,"Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."):void 0,"production"!==t.env.NODE_ENV?Y(!n.contentEditable||null==n.children,"A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."):void 0),null!=n.style&&"object"!=typeof n.style?"production"!==t.env.NODE_ENV?B(!1,"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.%s",o(e)):B(!1):void 0)}function d(e,n,o,r){"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?Y("onScroll"!==n||$("scroll",!0),"This browser doesn't support the `onScroll` event"):void 0);var i=P.findReactContainerForID(e);if(i){var a=i.nodeType===ne?i.ownerDocument:i;G(n,a)}r.getReactMountReady().enqueue(f,{id:e,registrationName:n,listener:o})}function f(){var e=this;T.putListener(e.id,e.registrationName,e.listener)}function h(){var e=this;e._rootNodeID?void 0:"production"!==t.env.NODE_ENV?B(!1,"Must be mounted to trap events"):B(!1);var n=P.getNode(e._rootNodeID);switch(n?void 0:"production"!==t.env.NODE_ENV?B(!1,"trapBubbledEvent(...): Requires node to be rendered."):B(!1),e._tag){case"iframe":e._wrapperState.listeners=[T.trapBubbledEvent(D.topLevelTypes.topLoad,"load",n)];break;case"video":case"audio":e._wrapperState.listeners=[];for(var o in re)re.hasOwnProperty(o)&&e._wrapperState.listeners.push(T.trapBubbledEvent(D.topLevelTypes[o],re[o],n));break;case"img":e._wrapperState.listeners=[T.trapBubbledEvent(D.topLevelTypes.topError,"error",n),T.trapBubbledEvent(D.topLevelTypes.topLoad,"load",n)];break;case"form":e._wrapperState.listeners=[T.trapBubbledEvent(D.topLevelTypes.topReset,"reset",n),T.trapBubbledEvent(D.topLevelTypes.topSubmit,"submit",n)]}}function m(){S.mountReadyWrapper(this)}function v(){I.postUpdateWrapper(this)}function g(e){ce.call(le,e)||(ue.test(e)?void 0:"production"!==t.env.NODE_ENV?B(!1,"Invalid tag: %s",e):B(!1),le[e]=!0)}function y(e,t){e=j({},e);var n=e[K.ancestorInfoContextKey];return e[K.ancestorInfoContextKey]=K.updatedAncestorInfo(n,t._tag,t),e}function b(e,t){return e.indexOf("-")>=0||null!=t.is}function E(e){g(e),this._tag=e.toLowerCase(),this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._rootNodeID=null,this._wrapperState=null,this._topLevelWrapper=null,this._nodeWithLegacyProperties=null,"production"!==t.env.NODE_ENV&&(this._unprocessedContextDev=null,this._processedContextDev=null)}var N,C=n(109),x=n(111),_=n(38),w=n(37),D=n(45),T=n(44),O=n(41),k=n(119),S=n(120),M=n(124),I=n(127),R=n(128),P=n(43),A=n(129),L=n(33),V=n(68),j=n(54),U=n(58),F=n(36),B=n(28),$=n(55),H=n(94),q=n(34),W=n(35),z=n(132),K=n(85),Y=n(40),X=T.deleteListener,G=T.listenTo,Q=T.registrationNameModules,J={string:!0,number:!0},Z=H({children:null}),ee=H({style:null}),te=H({__html:null}),ne=1;"production"!==t.env.NODE_ENV&&(N={props:{enumerable:!1,get:function(){var e=this._reactInternalComponent;return"production"!==t.env.NODE_ENV?Y(!1,"ReactDOMComponent: Do not access .props of a DOM node; instead, recreate the props as `render` did originally or read the DOM properties/attributes directly from this node (e.g., this.refs.box.className).%s",o(e)):void 0,e._currentElement.props}}});var oe={},re={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},ie={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ae={listing:!0,pre:!0,textarea:!0},se=j({menuitem:!0},ie),ue=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,le={},ce={}.hasOwnProperty;E.displayName="ReactDOMComponent",E.Mixin={construct:function(e){this._currentElement=e},mountComponent:function(e,n,o){this._rootNodeID=e;var r=this._currentElement.props;switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":this._wrapperState={listeners:null},n.getReactMountReady().enqueue(h,this);break;case"button":r=k.getNativeProps(this,r,o);break;case"input":S.mountWrapper(this,r,o),r=S.getNativeProps(this,r,o);break;case"option":M.mountWrapper(this,r,o),r=M.getNativeProps(this,r,o);break;case"select":I.mountWrapper(this,r,o),r=I.getNativeProps(this,r,o),o=I.processChildContext(this,r,o);break;case"textarea":R.mountWrapper(this,r,o),r=R.getNativeProps(this,r,o)}p(this,r),"production"!==t.env.NODE_ENV&&o[K.ancestorInfoContextKey]&&K(this._tag,this,o[K.ancestorInfoContextKey]),"production"!==t.env.NODE_ENV&&(this._unprocessedContextDev=o,this._processedContextDev=y(o,this),o=this._processedContextDev);var i;if(n.useCreateElement){var a=o[P.ownerDocumentContextKey],s=a.createElement(this._currentElement.type);w.setAttributeForID(s,this._rootNodeID),P.getID(s),this._updateDOMProperties({},r,n,s),this._createInitialChildren(n,r,o,s),i=s}else{var u=this._createOpenTagMarkupAndPutListeners(n,r),l=this._createContentMarkup(n,r,o);i=!l&&ie[this._tag]?u+"/>":u+">"+l+""}switch(this._tag){case"input":n.getReactMountReady().enqueue(m,this);case"button":case"select":case"textarea":r.autoFocus&&n.getReactMountReady().enqueue(C.focusDOMComponent,this)}return i},_createOpenTagMarkupAndPutListeners:function(e,n){var o="<"+this._currentElement.type;for(var r in n)if(n.hasOwnProperty(r)){var i=n[r];if(null!=i)if(Q.hasOwnProperty(r))i&&d(this._rootNodeID,r,i,e);else{r===ee&&(i&&("production"!==t.env.NODE_ENV&&(this._previousStyle=i),i=this._previousStyleCopy=j({},n.style)),i=x.createMarkupForStyles(i));var a=null;null!=this._tag&&b(this._tag,n)?r!==Z&&(a=w.createMarkupForCustomAttribute(r,i)):a=w.createMarkupForProperty(r,i),a&&(o+=" "+a)}}if(e.renderToStaticMarkup)return o;var s=w.createMarkupForID(this._rootNodeID);return o+" "+s},_createContentMarkup:function(e,t,n){var o="",r=t.dangerouslySetInnerHTML;if(null!=r)null!=r.__html&&(o=r.__html);else{var i=J[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)o=F(i);else if(null!=a){var s=this.mountChildren(a,e,n);o=s.join("")}}return ae[this._tag]&&"\n"===o.charAt(0)?"\n"+o:o},_createInitialChildren:function(e,t,n,o){var r=t.dangerouslySetInnerHTML;if(null!=r)null!=r.__html&&q(o,r.__html);else{var i=J[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)W(o,i);else if(null!=a)for(var s=this.mountChildren(a,e,n),u=0;u tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg , , and ) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.",this._tag):B(!1)}if(this.unmountChildren(),T.deleteAllListeners(this._rootNodeID),O.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null,this._wrapperState=null,this._nodeWithLegacyProperties){var o=this._nodeWithLegacyProperties;o._reactInternalComponent=null,this._nodeWithLegacyProperties=null}},getPublicInstance:function(){if(!this._nodeWithLegacyProperties){var e=P.getNode(this._rootNodeID);e._reactInternalComponent=this,e.getDOMNode=r,e.isMounted=i,e.setState=a,e.replaceState=a,e.forceUpdate=a,e.setProps=s,e.replaceProps=u,"production"!==t.env.NODE_ENV&&U?Object.defineProperties(e,N):e.props=this._currentElement.props,this._nodeWithLegacyProperties=e}return this._nodeWithLegacyProperties}},L.measureMethods(E,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),j(E.prototype,E.Mixin,A.Mixin),e.exports=E}).call(t,n(19))},function(e,t,n){"use strict";var o=n(43),r=n(106),i=n(110),a={componentDidMount:function(){this.props.autoFocus&&i(r(this))}},s={Mixin:a,focusDOMComponent:function(){i(o.getNode(this._rootNodeID))}};e.exports=s},function(e,t){"use strict";function n(e){try{e.focus()}catch(t){}}e.exports=n},function(e,t,n){(function(t){"use strict";var o=n(112),r=n(24),i=n(33),a=n(113),s=n(115),u=n(116),l=n(118),c=n(40),p=l(function(e){return u(e)}),d=!1,f="cssFloat";if(r.canUseDOM){var h=document.createElement("div").style;try{h.font=""}catch(m){d=!0}void 0===document.documentElement.style.cssFloat&&(f="styleFloat")}if("production"!==t.env.NODE_ENV)var v=/^(?:webkit|moz|o)[A-Z]/,g=/;\s*$/,y={},b={},E=function(e){y.hasOwnProperty(e)&&y[e]||(y[e]=!0,"production"!==t.env.NODE_ENV?c(!1,"Unsupported style property %s. Did you mean %s?",e,a(e)):void 0)},N=function(e){y.hasOwnProperty(e)&&y[e]||(y[e]=!0,"production"!==t.env.NODE_ENV?c(!1,"Unsupported vendor-prefixed style property %s. Did you mean %s?",e,e.charAt(0).toUpperCase()+e.slice(1)):void 0)},C=function(e,n){b.hasOwnProperty(n)&&b[n]||(b[n]=!0,"production"!==t.env.NODE_ENV?c(!1,'Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.',e,n.replace(g,"")):void 0)},x=function(e,t){e.indexOf("-")>-1?E(e):v.test(e)?N(e):g.test(t)&&C(e,t)};var _={createMarkupForStyles:function(e){var n="";for(var o in e)if(e.hasOwnProperty(o)){var r=e[o];"production"!==t.env.NODE_ENV&&x(o,r),null!=r&&(n+=p(o)+":",n+=s(o,r)+";")}return n||null},setValueForStyles:function(e,n){var r=e.style;for(var i in n)if(n.hasOwnProperty(i)){"production"!==t.env.NODE_ENV&&x(i,n[i]);var a=s(i,n[i]);if("float"===i&&(i=f),a)r[i]=a;else{var u=d&&o.shorthandPropertyExpansions[i];if(u)for(var l in u)r[l]="";else r[i]=""}}}};i.measureMethods(_,"CSSPropertyOperations",{setValueForStyles:"setValueForStyles"}),e.exports=_}).call(t,n(19))},function(e,t){"use strict";function n(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var o={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0},r=["Webkit","ms","Moz","O"];Object.keys(o).forEach(function(e){r.forEach(function(t){o[n(t,e)]=o[e]})});var i={background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},a={isUnitlessNumber:o,shorthandPropertyExpansions:i};e.exports=a},function(e,t,n){"use strict";function o(e){return r(e.replace(i,"ms-"))}var r=n(114),i=/^-ms-/;e.exports=o},function(e,t){"use strict";function n(e){return e.replace(o,function(e,t){return t.toUpperCase()})}var o=/-(.)/g;e.exports=n},function(e,t,n){"use strict";function o(e,t){var n=null==t||"boolean"==typeof t||""===t;if(n)return"";var o=isNaN(t);return o||0===t||i.hasOwnProperty(e)&&i[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}var r=n(112),i=r.isUnitlessNumber;e.exports=o},function(e,t,n){"use strict";function o(e){return r(e).replace(i,"-ms-")}var r=n(117),i=/^ms-/;e.exports=o},function(e,t){"use strict";function n(e){return e.replace(o,"-$1").toLowerCase()}var o=/([A-Z])/g;e.exports=n},function(e,t){"use strict";function n(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}e.exports=n},function(e,t){"use strict";var n={onClick:!0,onDoubleClick:!0,onMouseDown:!0,onMouseMove:!0,onMouseUp:!0,onClickCapture:!0,onDoubleClickCapture:!0,onMouseDownCapture:!0,onMouseMoveCapture:!0,onMouseUpCapture:!0},o={getNativeProps:function(e,t,o){if(!t.disabled)return t;var r={};for(var i in t)t.hasOwnProperty(i)&&!n[i]&&(r[i]=t[i]);return r}};e.exports=o},function(e,t,n){(function(t){"use strict";function o(){this._rootNodeID&&d.updateWrapper(this)}function r(e){var n=this._currentElement.props,r=a.executeOnChange(n,e);u.asap(o,this);var i=n.name;if("radio"===n.type&&null!=i){for(var l=s.getNode(this._rootNodeID),d=l;d.parentNode;)d=d.parentNode;for(var f=d.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),h=0;h>"}var y=n(57),b=n(81),E=n(30),N=n(123),C="<>",x={array:r("array"),bool:r("boolean"),func:r("function"),number:r("number"),object:r("object"),string:r("string"),any:i(),arrayOf:a,element:s(),instanceOf:u,node:d(),objectOf:c,oneOf:l,oneOfType:p,shape:f};e.exports=x},function(e,t){"use strict";function n(e){var t=e&&(o&&e[o]||e[r]);return"function"==typeof t?t:void 0}var o="function"==typeof Symbol&&Symbol.iterator,r="@@iterator";e.exports=n},function(e,t,n){(function(t){"use strict";var o=n(125),r=n(127),i=n(54),a=n(40),s=r.valueContextKey,u={mountWrapper:function(e,n,o){"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?a(null==n.selected,"Use the `defaultValue` or `value` props on must be a scalar value if `multiple` is false.%s",a,r(o)):void 0)}}function a(e,t,n){var o,r,i=l.getNode(e._rootNodeID).options;if(t){for(o={},r=0;r."):l(!1):void 0;var r=u({},n,{defaultValue:void 0,value:void 0,children:e._wrapperState.initialValue,onChange:e._wrapperState.onChange});return r},mountWrapper:function(e,n){"production"!==t.env.NODE_ENV&&i.checkPropTypes("textarea",n,e._currentElement._owner);var o=n.defaultValue,a=n.children;null!=a&&("production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?c(!1,"Use the `defaultValue` or `value` props instead of setting children on