Commit b57294d0 authored by Adrià Labay's avatar Adrià Labay
Browse files

fix error when delaying process with passing an enumerate

parent 11742f35
......@@ -136,7 +136,7 @@ class NavBar extends React.Component {
api.get('exams')
.then(exams => {
let exam = exams.find(exam => exam.id === this.state.examID)
if (!exam && exams.length > 1) exam = exams[exams.length - 1]
if (!exam && exams.length) exam = exams[exams.length - 1]
this.setState(prevState => ({
examList: exams,
......
......@@ -77,8 +77,10 @@ class PanelEditUnstructured extends React.Component {
}
componentWillMount = () => {
if (!this.state.examID && this.props.examID !== this.state.examID) {
this.setState({examID: this.props.examID}, () => this.loadProblems(null))
if (this.props.examID !== null) {
this.setState(
{ examID: this.props.examID }, () => this.loadProblems(null)
)
}
}
......
......@@ -89,7 +89,7 @@ class Scans(Resource):
# TODO: save these into a process-local datastructure, or save
# it into the DB as well so that we can cull 'processing' tasks
# that are actually dead.
process_scan.delay(scan_id=scan.id, scan_type=exam.layout)
process_scan.delay(scan_id=scan.id, scan_type=exam.layout.value)
return {
'id': scan.id,
......
......@@ -48,7 +48,7 @@ def process_scan(scan_id, scan_type):
signal.signal(signal_type, raise_exit)
try:
_process_scan(scan_id, scan_type)
_process_scan(scan_id, ExamLayout(scan_type))
except BaseException as error:
# TODO: When #182 is implemented, properly separate user-facing
# messages (written to DB) from developer-facing messages,
......
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