added explanatory join flow comments

This commit is contained in:
Ben Wheeler 2019-08-30 16:19:27 -04:00
parent e44d52b735
commit f7a70475e2
2 changed files with 7 additions and 1 deletions

View file

@ -95,6 +95,7 @@ class CountryStep extends React.Component {
validate={this.validateSelect}
validationClassName="validation-full-width-input"
/>
{/* note that this is a hidden checkbox the user will never see */}
<FormikCheckbox
id="yesno"
label={this.props.intl.formatMessage({id: 'registration.receiveEmails'})}

View file

@ -59,7 +59,9 @@ class JoinFlow extends React.Component {
country: formData.country,
subscribe: true,
is_robot: formData.yesno
// csrfmiddlewaretoken: 'abc'
// no need to include csrfmiddlewaretoken; will be provided in
// X-CSRFToken header, which scratchr2 looks for in
// scratchr2/middleware/csrf.py line 237.
}
/* eslint-enable quote-props */
}, (err, body, res) => {
@ -75,6 +77,9 @@ class JoinFlow extends React.Component {
return;
}
if (body[0].errors) {
// body can include zero or more error objects, each
// with its own key and description. Here we assemble
// all of them into a single string, errStr.
const errorKeys = Object.keys(body[0].errors);
errorKeys.forEach(key => {
const val = body[0].errors[key];