You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
helper.checkWebOodi(req,res,user,resolve)// this does not work.
285
294
286
295
setTimeout(function(){
296
+
overkillLogging(req,null)
287
297
resolve('shitaintright')// Yay! everything went to hell.
288
298
},5000)// set a high timeout value since you really want to wait x)
289
299
})
290
300
291
301
if(webOodiStatus!=='found'){
292
-
// Temporarily allow non-registered users past until issue with registered users being blocked is resolved.
293
-
console.warn(`Expected user to be found in Kurki students. status - expected: found, actual: ${webOodiStatus}`)
294
-
console.warn(`The following user was not found to have been registered in weboodi to course ${req.params.ohid}. Proceeding anyway.`,user)
295
-
}else{
296
-
res.status(400).send({
297
-
message: 'something went wrong'
302
+
overkillLogging(req,null)
303
+
returnres.status(403).json({
304
+
message: 'You have not yet registered to this course at WebOodi. If you have already registered at WebOodi, try again in two hours.'
298
305
})
299
306
}
300
307
letstudent
@@ -312,14 +319,26 @@ module.exports = {
312
319
projectName: req.body.projectName||''// model would like to validate this to alphanumeric but seems like this needs specific nulls or empties or whatever
313
320
}
314
321
})
315
-
}catch(e){
316
-
res.status(400).send({
317
-
message: error.errors
322
+
}catch(error){
323
+
if(error.name==='SequelizeValidationError'){
324
+
constvalidationErrorMessages={
325
+
github: 'Github repository link is not a proper url.',
326
+
projectName: 'Project name contains illegal characters.'
0 commit comments