mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix profile update
This commit is contained in:
@@ -168,6 +168,7 @@ SocketUser.updateProfile = function(socket, data, callback) {
|
||||
newUsername: userData.username
|
||||
});
|
||||
}
|
||||
callback(null, userData);
|
||||
}
|
||||
|
||||
if (socket.uid === parseInt(data.uid, 10)) {
|
||||
@@ -175,12 +176,8 @@ SocketUser.updateProfile = function(socket, data, callback) {
|
||||
}
|
||||
|
||||
user.isAdministrator(socket.uid, function(err, isAdmin) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (!isAdmin) {
|
||||
return callback(new Error('[[error:no-privileges]]'));
|
||||
if (err || !isAdmin) {
|
||||
return callback(err || new Error('[[error:no-privileges]]'));
|
||||
}
|
||||
|
||||
user.updateProfile(data.uid, data, done);
|
||||
|
||||
Reference in New Issue
Block a user