equal
deleted
inserted
replaced
60 <Trans i18nKey="login.login_error">Unable to log in.</Trans> |
60 <Trans i18nKey="login.login_error">Unable to log in.</Trans> |
61 </div> |
61 </div> |
62 ) |
62 ) |
63 } |
63 } |
64 |
64 |
65 const errors = R.path(['data','non_field_errors'], errorMessages); |
65 const errors = R.reduce( |
66 if (errors) { |
66 (acc, p) => R.concat(acc, R.ifElse(Array.isArray, R.identity, v => [v,])(R.pathOr([], ['data', p], errorMessages))), |
|
67 [], |
|
68 ['non_field_errors', 'detail'] |
|
69 ); |
|
70 if (errors && errors.length > 0 ) { |
67 return ( |
71 return ( |
68 <div className="alert alert-danger mt-4" role="alert"> |
72 <div className="alert alert-danger mt-4" role="alert"> |
69 { errors.map((message, key) => |
73 { errors.map((message, key) => |
70 <p key={ key }><Trans i18nKey="login.credentials_error">{ message }</Trans></p> |
74 <p key={ key }><Trans i18nKey="login.credentials_error">{ message }</Trans></p> |
71 ) } |
75 ) } |