Skip to content
Snippets Groups Projects
Commit c84642c5 authored by Gabriel Engel's avatar Gabriel Engel Committed by GitHub
Browse files

Merge pull request #5970 from RocketChat/fix/5949-active-new-users

Fix error when activating new users
parents 9a090d16 40e6f9ee
No related branches found
No related tags found
No related merge requests found
...@@ -17,10 +17,12 @@ Meteor.methods({ ...@@ -17,10 +17,12 @@ Meteor.methods({
const user = RocketChat.models.Users.findOneById(userId); const user = RocketChat.models.Users.findOneById(userId);
if (user && user.username) { if (user) {
RocketChat.models.Users.setUserActive(userId, active); RocketChat.models.Users.setUserActive(userId, active);
RocketChat.models.Subscriptions.setArchivedByUsername(user.username, !active); if (user.username) {
RocketChat.models.Subscriptions.setArchivedByUsername(user.username, !active);
}
if (active === false) { if (active === false) {
RocketChat.models.Users.unsetLoginTokens(userId); RocketChat.models.Users.unsetLoginTokens(userId);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment