Skip to content

Commit

Permalink
Fix complete user with settings on account, bug if no role
Browse files Browse the repository at this point in the history
  • Loading branch information
polo2ro committed Feb 23, 2020
1 parent 8dbed87 commit 1b97cd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions modules/userComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ exports = module.exports = function userComplete(userDoc)
var calendar = results[1];
var departments = results[2];

user.roles.account.currentCollection = null;
if (user.roles.account) {
user.roles.account.currentCollection = null;

if (null !== collection && undefined !== collection) {
user.roles.account.currentCollection = collection.toObject();
}
if (null !== collection && undefined !== collection) {
user.roles.account.currentCollection = collection.toObject();
}

if (null !== calendar && undefined !== calendar) {
user.roles.account.currentScheduleCalendar = calendar.toObject();
if (null !== calendar && undefined !== calendar) {
user.roles.account.currentScheduleCalendar = calendar.toObject();
}
}

if (null !== departments && undefined !== departments) {
Expand Down

0 comments on commit 1b97cd3

Please sign in to comment.