aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users/index.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-20 10:13:13 +0200
committerChocobozzz <me@florianbigard.com>2018-09-20 11:45:59 +0200
commit91411dba928678c15a5e99d9795ae061909e397d (patch)
tree7ba6e340cc9eb6f993051fcac74eefd652cb0ffd /server/controllers/api/users/index.ts
parentfcc7c060374c3a547257d96af847352c14d6144b (diff)
downloadPeerTube-91411dba928678c15a5e99d9795ae061909e397d.tar.gz
PeerTube-91411dba928678c15a5e99d9795ae061909e397d.tar.zst
PeerTube-91411dba928678c15a5e99d9795ae061909e397d.zip
Limit associations fetch when loading token
Diffstat (limited to 'server/controllers/api/users/index.ts')
-rw-r--r--server/controllers/api/users/index.ts16
1 files changed, 3 insertions, 13 deletions
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts
index a299167e8..d1163900b 100644
--- a/server/controllers/api/users/index.ts
+++ b/server/controllers/api/users/index.ts
@@ -267,15 +267,9 @@ async function updateUser (req: express.Request, res: express.Response, next: ex
267 const user = await userToUpdate.save() 267 const user = await userToUpdate.save()
268 268
269 // Destroy user token to refresh rights 269 // Destroy user token to refresh rights
270 if (roleChanged) { 270 if (roleChanged) await OAuthTokenModel.deleteUserToken(userToUpdate.id)
271 await OAuthTokenModel.deleteUserToken(userToUpdate.id)
272 }
273 271
274 auditLogger.update( 272 auditLogger.update(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON()), oldUserAuditView)
275 getAuditIdFromRes(res),
276 new UserAuditView(user.toFormattedJSON()),
277 oldUserAuditView
278 )
279 273
280 // Don't need to send this update to followers, these attributes are not propagated 274 // Don't need to send this update to followers, these attributes are not propagated
281 275
@@ -343,9 +337,5 @@ async function changeUserBlock (res: express.Response, user: UserModel, block: b
343 337
344 await Emailer.Instance.addUserBlockJob(user, block, reason) 338 await Emailer.Instance.addUserBlockJob(user, block, reason)
345 339
346 auditLogger.update( 340 auditLogger.update(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON()), oldUserAuditView)
347 getAuditIdFromRes(res),
348 new UserAuditView(user.toFormattedJSON()),
349 oldUserAuditView
350 )
351} 341}