0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Fix for bug where owner user has name owner

no issue

- in the case that the role is not being assigned, the code assumes it doesn't get a role..
This commit is contained in:
Hannah Wolfe 2014-08-11 10:51:14 +01:00
parent 1e9db1ac0f
commit 5381db37cd

View file

@ -403,7 +403,7 @@ User = ghostBookshelf.Model.extend({
return user.roles().fetch().then(function (roles) {
// return if the role is already assigned
if (roles.models[0].id === roleId) {
return user;
return;
}
return Role.findOne({id: roleId});
}).then(function (roleToAssign) {