Commit 16e8b513 by Arturo Montejo Ráez

Merge branch 'master' into develop

parents a04afb81 74a678dd
# Changes
Changes to be performed manually in servers to upgrade
Nothing to do
## Database
......
......@@ -169,6 +169,20 @@ module.exports = {
if (student.supervision == -1) // should not hace access!!!
return res.forbidden("Access to this student should not be granted to you");
// Promisify asynchronous call to Student.supervisors
var supervisors = new Promise(function(resolve, reject) {
Student.supervisors(student.id, (err, ss) => {
if (err) return reject(err);
return resolve(ss);
});
});
return [student, supervisors];
})
.spread((student, supervisors) => {
student.supervisors = supervisors;
console.log(JSON.stringify(supervisors));
console.log(JSON.stringify(student.supervisors));
return res.ok(student);
})
.catch(function (err) {
......
......@@ -105,6 +105,8 @@ module.exports = {
if (!supervisor.isSupAdmin && !stuSup)
throw new Error("Supervisor without students");
supervisor.isSup = true;
return res.ok({
user: supervisor,
server_time: (new Date()).getTime(),
......
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