Commit 54299bdf by Fernando Martínez Santiago Committed by root

issue #799, #804

parent 3d548583
......@@ -42,5 +42,14 @@ module.exports = {
type: "string",
size: 1024
}
},
afterUpdate: function (attrs, next) {
StuOpenTry.findOne({id_ws: attrs.workingSession}).exec(function(err, stuopentry) {
if (err)
throw new Error("Error at"+attrs.workingSession+"("+err+")");
if (stuopentry)
attrs.next_try_id=stuopentry.openTry;
next();
});
}
}
\ No newline at end of file
......@@ -79,7 +79,15 @@ module.exports = {
next(err);
})
},
afterCreate: function (attrs, next) {
StuOpenTry.findOne({id_ws: attrs.id}).exec(function(err, stuopentry) {
if (err || !stuopentry)
throw new Error("No try found at"+attrs.id+"("+err+")");
attrs.first_try_id=stuopentry.openTry;
next();
});
},
//
// Returns the number of working sessions per year (REPORTS)
......
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 sign in to comment