diff options
Diffstat (limited to 'server/lib/user.ts')
-rw-r--r-- | server/lib/user.ts | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/server/lib/user.ts b/server/lib/user.ts index 5653d8e65..c4722fae2 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts | |||
@@ -1,14 +1,13 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import { createPrivateAndPublicKeys } from '../helpers/peertube-crypto' | 2 | import { createPrivateAndPublicKeys, logger } from '../helpers' |
3 | import { database as db } from '../initializers' | 3 | import { CONFIG, sequelizeTypescript } from '../initializers' |
4 | import { CONFIG } from '../initializers/constants' | 4 | import { AccountModel } from '../models/account/account' |
5 | import { UserInstance } from '../models' | 5 | import { UserModel } from '../models/account/user' |
6 | import { getAccountActivityPubUrl } from './activitypub' | ||
6 | import { createVideoChannel } from './video-channel' | 7 | import { createVideoChannel } from './video-channel' |
7 | import { logger } from '../helpers/logger' | ||
8 | import { getAccountActivityPubUrl } from './activitypub/url' | ||
9 | 8 | ||
10 | async function createUserAccountAndChannel (user: UserInstance, validateUser = true) { | 9 | async function createUserAccountAndChannel (user: UserModel, validateUser = true) { |
11 | const { account, videoChannel } = await db.sequelize.transaction(async t => { | 10 | const { account, videoChannel } = await sequelizeTypescript.transaction(async t => { |
12 | const userOptions = { | 11 | const userOptions = { |
13 | transaction: t, | 12 | transaction: t, |
14 | validate: validateUser | 13 | validate: validateUser |
@@ -38,7 +37,7 @@ async function createUserAccountAndChannel (user: UserInstance, validateUser = t | |||
38 | async function createLocalAccountWithoutKeys (name: string, userId: number, applicationId: number, t: Sequelize.Transaction) { | 37 | async function createLocalAccountWithoutKeys (name: string, userId: number, applicationId: number, t: Sequelize.Transaction) { |
39 | const url = getAccountActivityPubUrl(name) | 38 | const url = getAccountActivityPubUrl(name) |
40 | 39 | ||
41 | const accountInstance = db.Account.build({ | 40 | const accountInstance = new AccountModel({ |
42 | name, | 41 | name, |
43 | url, | 42 | url, |
44 | publicKey: null, | 43 | publicKey: null, |