notification email on student unlinking

parent 5d2a91be
Showing with 5 additions and 3 deletions
...@@ -118,10 +118,12 @@ module.exports = { ...@@ -118,10 +118,12 @@ module.exports = {
if (!student.name || student.name.length == 0) if (!student.name || student.name.length == 0)
student.name = sails.__({phrase: 'no_name', locale: student.lang}); student.name = sails.__({phrase: 'no_name', locale: student.lang});
if (!student.surname || student.surname.length == 0) if (!student.surname || student.surname.length == 0)
student.surname = sails.__({phrase: 'no_surname', locale: student.lang}); student.surname = sails.__({phrase: 'no_surname', locale: student.lang});
student.attributes = Student.getValidAttributes(student.attributes); student.attributes = Student.getValidAttributes(student.attributes);
student.current_method = student.lastInstruction[0] ? student.lastInstruction[0].met_name : "no_method"; if (student.lastInstruction && student.lastInstruction[0]) {
student.current_instruction = student.lastInstruction[0] ? student.lastInstruction[0].ins_name : "no_instruction"; student.current_method = student.lastInstruction[0] ? student.lastInstruction[0].met_name : "no_method";
student.current_instruction = student.lastInstruction[0] ? student.lastInstruction[0].ins_name : "no_instruction";
}
delete student.password; delete student.password;
return student; return student;
}, },
......
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