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
5e8ab03a
authored
Sep 13, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
working on issue #581
parent
13f9c9bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
sails/src/api/controllers/SupervisorController.js
sails/src/api/controllers/SupervisorController.js
View file @
5e8ab03a
...
@@ -75,9 +75,6 @@ module.exports = {
...
@@ -75,9 +75,6 @@ module.exports = {
var
stuSup
=
StuSup
.
findOne
({
id_sup
:
supervisor
.
id
})
var
stuSup
=
StuSup
.
findOne
({
id_sup
:
supervisor
.
id
})
.
then
(
function
(
stuSup
)
{
.
then
(
function
(
stuSup
)
{
if
(
!
stuSup
)
throw
new
Error
(
"User without students linked to"
);
return
stuSup
;
return
stuSup
;
});
});
...
@@ -90,9 +87,13 @@ module.exports = {
...
@@ -90,9 +87,13 @@ module.exports = {
}).
spread
(
function
(
office
,
stuSup
,
supervisor
)
{
}).
spread
(
function
(
office
,
stuSup
,
supervisor
)
{
supervisor
.
office
=
office
;
if
(
office
)
{
if
(
office
)
supervisor
.
office
=
office
;
supervisor
.
isSupAdmin
=
(
office
.
admin
===
supervisor
.
id
);
supervisor
.
isSupAdmin
=
(
office
.
admin
===
supervisor
.
id
);
}
if
(
!
supervisor
.
isSupAdmin
&&
!
stuSup
)
throw
new
Error
(
"User without students linked to"
);
return
res
.
ok
({
return
res
.
ok
({
user
:
supervisor
,
user
:
supervisor
,
...
...
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