fixing issue with mail subject localization

parent a0066eaa
......@@ -379,6 +379,7 @@ module.exports = {
// As it can be resolved through two possibilities, better to use promises!
//
var getStudent = new Promise(function(resolve, reject) {
if (!params.id_stu && params.license) {
// get student, license attribute will be completed
License.getStudent(params.license, function(err, s) {
......@@ -462,16 +463,18 @@ module.exports = {
* @param {response} {}
*/
unlink_supervisor: function (req, res) {
var params = req.allParams();
StuSup.findOne({
student: req.param('id_stu'),
supervisor: req.param('id_sup')
student: params.id_stu,
supervisor: params.id_sup
})
.populate('supervisor')
.then((stuSup) => {
if (!stuSup)
throw new Error("student and supervisor are not linked");
return [stuSup, Student.findOne(req.params.id_stu).populate('license')];
return [stuSup, Student.findOne(params.id_stu).populate('license')];
})
.spread((stuSup, student) => {
......@@ -502,7 +505,7 @@ module.exports = {
var subject = sails.__({
phrase: 'notification_from_pictogram',
locale: params.lang || 'es-es'
locale: supervisor.lang || 'es-es'
});
console.log("-->" + message);
......
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