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
e78e0533
authored
Dec 12, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fixed problem with missing students in office admin list
parent
4ba9dd64
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
sails/src/api/models/Supervisor.js
sails/src/api/models/Supervisor.js
View file @
e78e0533
...
...
@@ -259,6 +259,7 @@ module.exports = {
function
(
err
)
{
// loop has end
// Get all students from the office if user is administrator
if
(
sup
.
office
&&
sup
.
office
.
admin
==
sup
.
id
)
{
var
officeStudents
;
Student
.
find
({
office
:
sup
.
office
.
id
}).
populate
(
'lastInstruction'
)
.
then
(
function
(
officeStudents
)
{
...
...
@@ -268,14 +269,13 @@ module.exports = {
student
.
current_instruction
=
student
.
lastInstruction
[
0
]
?
student
.
lastInstruction
[
0
].
ins_name
:
"no_instruction"
;
return
student
;
});
l
.
concat
(
officeStudents
);
callback
(
null
,
lodash
.
uniq
(
l
,
false
,
'id'
));
l
=
l
.
concat
(
officeStudents
);
callback
(
err
,
lodash
.
uniq
(
l
,
false
,
'id'
));
})
.
catch
(
function
(
err
)
{
callback
(
err
,
l
);
});
}
callback
(
err
,
l
);
});
// end async.eachSeries
})
.
catch
((
err
)
=>
{
...
...
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