--- a/client/src/components/Login.js Wed Nov 28 15:45:37 2018 +0100
+++ b/client/src/components/Login.js Wed Nov 28 18:25:11 2018 +0100
@@ -62,8 +62,12 @@
)
}
- const errors = R.path(['data','non_field_errors'], errorMessages);
- if (errors) {
+ const errors = R.reduce(
+ (acc, p) => R.concat(acc, R.ifElse(Array.isArray, R.identity, v => [v,])(R.pathOr([], ['data', p], errorMessages))),
+ [],
+ ['non_field_errors', 'detail']
+ );
+ if (errors && errors.length > 0 ) {
return (
<div className="alert alert-danger mt-4" role="alert">
{ errors.map((message, key) =>