Commit 401edb35 authored by Ray Schamp's avatar Ray Schamp Committed by GitHub

Merge pull request #751 from rschamp/bugfix/747

Show an error if the API doesn't return class data
parents 7ae7db76 61e21f6b
......@@ -37,10 +37,12 @@ var StudentCompleteRegistration = intl.injectIntl(React.createClass({
this.props.session.session.permissions &&
this.props.session.session.permissions.student) {
var classroomId = this.props.session.session.user.classroomId;
this.setState({waiting: true});
api({
uri: '/classrooms/' + classroomId
}, function (err, body, res) {
if (err || res.statusCode === 404) {
this.setState({waiting: false});
if (err || res.statusCode !== 200) {
return this.setState({
registrationErrors: {
__all__: this.props.intl.formatMessage({id: 'studentRegistration.classroomApiGeneralError'})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment