From e34c85e527100c0b5c44567bd951e95be41b8d7e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 14 Nov 2017 10:57:56 +0100 Subject: Fix issues on server start --- server/lib/user.ts | 3 ++- server/lib/video-channel.ts | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'server/lib') diff --git a/server/lib/user.ts b/server/lib/user.ts index 1094c2401..d2d599dfd 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts @@ -16,8 +16,9 @@ async function createUserAccountAndChannel (user: UserInstance, validateUser = t const userCreated = await user.save(userOptions) const accountCreated = await createLocalAccount(user.username, user.id, null, t) + const videoChannelName = `Default ${userCreated.username} channel` const videoChannelInfo = { - name: `Default ${userCreated.username} channel` + name: videoChannelName } const videoChannel = await createVideoChannel(videoChannelInfo, accountCreated, t) diff --git a/server/lib/video-channel.ts b/server/lib/video-channel.ts index 459d9d4a8..13841ea33 100644 --- a/server/lib/video-channel.ts +++ b/server/lib/video-channel.ts @@ -5,6 +5,7 @@ import { logger } from '../helpers' import { AccountInstance } from '../models' import { VideoChannelCreate } from '../../shared/models' import { sendCreateVideoChannel } from './activitypub/send-request' +import { getActivityPubUrl } from '../helpers/activitypub' async function createVideoChannel (videoChannelInfo: VideoChannelCreate, account: AccountInstance, t: Sequelize.Transaction) { const videoChannelData = { @@ -15,6 +16,8 @@ async function createVideoChannel (videoChannelInfo: VideoChannelCreate, account } const videoChannel = db.VideoChannel.build(videoChannelData) + videoChannel.set('url', getActivityPubUrl('videoChannel', videoChannel.uuid)) + const options = { transaction: t } const videoChannelCreated = await videoChannel.save(options) -- cgit v1.2.3