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:
parent
1e9db1ac0f
commit
5381db37cd
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue