Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
326246e4
authored
Aug 14, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fixing issue with mail subject localization
parent
a0066eaa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
sails/src/api/controllers/StudentController.js
sails/src/api/controllers/StudentController.js
View file @
326246e4
...
@@ -379,6 +379,7 @@ module.exports = {
...
@@ -379,6 +379,7 @@ module.exports = {
// As it can be resolved through two possibilities, better to use promises!
// As it can be resolved through two possibilities, better to use promises!
//
//
var
getStudent
=
new
Promise
(
function
(
resolve
,
reject
)
{
var
getStudent
=
new
Promise
(
function
(
resolve
,
reject
)
{
if
(
!
params
.
id_stu
&&
params
.
license
)
{
if
(
!
params
.
id_stu
&&
params
.
license
)
{
// get student, license attribute will be completed
// get student, license attribute will be completed
License
.
getStudent
(
params
.
license
,
function
(
err
,
s
)
{
License
.
getStudent
(
params
.
license
,
function
(
err
,
s
)
{
...
@@ -462,16 +463,18 @@ module.exports = {
...
@@ -462,16 +463,18 @@ module.exports = {
* @param {response} {}
* @param {response} {}
*/
*/
unlink_supervisor
:
function
(
req
,
res
)
{
unlink_supervisor
:
function
(
req
,
res
)
{
var
params
=
req
.
allParams
();
StuSup
.
findOne
({
StuSup
.
findOne
({
student
:
req
.
param
(
'id_stu'
)
,
student
:
params
.
id_stu
,
supervisor
:
req
.
param
(
'id_sup'
)
supervisor
:
params
.
id_sup
})
})
.
populate
(
'supervisor'
)
.
populate
(
'supervisor'
)
.
then
((
stuSup
)
=>
{
.
then
((
stuSup
)
=>
{
if
(
!
stuSup
)
if
(
!
stuSup
)
throw
new
Error
(
"student and supervisor are not linked"
);
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
)
=>
{
.
spread
((
stuSup
,
student
)
=>
{
...
@@ -502,7 +505,7 @@ module.exports = {
...
@@ -502,7 +505,7 @@ module.exports = {
var
subject
=
sails
.
__
({
var
subject
=
sails
.
__
({
phrase
:
'notification_from_pictogram'
,
phrase
:
'notification_from_pictogram'
,
locale
:
params
.
lang
||
'es-es'
locale
:
supervisor
.
lang
||
'es-es'
});
});
console
.
log
(
"-->"
+
message
);
console
.
log
(
"-->"
+
message
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment