mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
added explanatory join flow comments
This commit is contained in:
parent
e44d52b735
commit
f7a70475e2
2 changed files with 7 additions and 1 deletions
|
@ -95,6 +95,7 @@ class CountryStep extends React.Component {
|
||||||
validate={this.validateSelect}
|
validate={this.validateSelect}
|
||||||
validationClassName="validation-full-width-input"
|
validationClassName="validation-full-width-input"
|
||||||
/>
|
/>
|
||||||
|
{/* note that this is a hidden checkbox the user will never see */}
|
||||||
<FormikCheckbox
|
<FormikCheckbox
|
||||||
id="yesno"
|
id="yesno"
|
||||||
label={this.props.intl.formatMessage({id: 'registration.receiveEmails'})}
|
label={this.props.intl.formatMessage({id: 'registration.receiveEmails'})}
|
||||||
|
|
|
@ -59,7 +59,9 @@ class JoinFlow extends React.Component {
|
||||||
country: formData.country,
|
country: formData.country,
|
||||||
subscribe: true,
|
subscribe: true,
|
||||||
is_robot: formData.yesno
|
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 */
|
/* eslint-enable quote-props */
|
||||||
}, (err, body, res) => {
|
}, (err, body, res) => {
|
||||||
|
@ -75,6 +77,9 @@ class JoinFlow extends React.Component {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (body[0].errors) {
|
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);
|
const errorKeys = Object.keys(body[0].errors);
|
||||||
errorKeys.forEach(key => {
|
errorKeys.forEach(key => {
|
||||||
const val = body[0].errors[key];
|
const val = body[0].errors[key];
|
||||||
|
|
Loading…
Reference in a new issue