From 8dc8a34ee8428e7657414115d1c137592efa174d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 23 Apr 2020 09:32:53 +0200 Subject: Avoir some circular dependencies --- server/middlewares/validators/activitypub/activity.ts | 2 +- server/middlewares/validators/blocklist.ts | 2 +- server/middlewares/validators/follows.ts | 2 +- server/middlewares/validators/videos/videos.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'server/middlewares/validators') diff --git a/server/middlewares/validators/activitypub/activity.ts b/server/middlewares/validators/activitypub/activity.ts index 7582f65e7..7350be5d5 100644 --- a/server/middlewares/validators/activitypub/activity.ts +++ b/server/middlewares/validators/activitypub/activity.ts @@ -1,7 +1,7 @@ import * as express from 'express' import { isRootActivityValid } from '../../../helpers/custom-validators/activitypub/activity' import { logger } from '../../../helpers/logger' -import { getServerActor } from '../../../helpers/utils' +import { getServerActor } from '@server/models/application/application' async function activityPubValidator (req: express.Request, res: express.Response, next: express.NextFunction) { logger.debug('Checking activity pub parameters') diff --git a/server/middlewares/validators/blocklist.ts b/server/middlewares/validators/blocklist.ts index b2183437c..c00a7e4df 100644 --- a/server/middlewares/validators/blocklist.ts +++ b/server/middlewares/validators/blocklist.ts @@ -6,9 +6,9 @@ import { AccountBlocklistModel } from '../../models/account/account-blocklist' import { isHostValid } from '../../helpers/custom-validators/servers' import { ServerBlocklistModel } from '../../models/server/server-blocklist' import { ServerModel } from '../../models/server/server' -import { getServerActor } from '../../helpers/utils' import { WEBSERVER } from '../../initializers/constants' import { doesAccountNameWithHostExist } from '../../helpers/middlewares' +import { getServerActor } from '@server/models/application/application' const blockAccountValidator = [ body('accountName').exists().withMessage('Should have an account name with host'), diff --git a/server/middlewares/validators/follows.ts b/server/middlewares/validators/follows.ts index a98d32d86..7808135f7 100644 --- a/server/middlewares/validators/follows.ts +++ b/server/middlewares/validators/follows.ts @@ -3,7 +3,6 @@ import { body, param, query } from 'express-validator' import { isTestInstance } from '../../helpers/core-utils' import { isEachUniqueHostValid, isHostValid } from '../../helpers/custom-validators/servers' import { logger } from '../../helpers/logger' -import { getServerActor } from '../../helpers/utils' import { SERVER_ACTOR_NAME, WEBSERVER } from '../../initializers/constants' import { ActorFollowModel } from '../../models/activitypub/actor-follow' import { areValidationErrors } from './utils' @@ -12,6 +11,7 @@ import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger' import { isActorTypeValid, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' import { MActorFollowActorsDefault } from '@server/typings/models' import { isFollowStateValid } from '@server/helpers/custom-validators/follows' +import { getServerActor } from '@server/models/application/application' const listFollowsValidator = [ query('state') diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 3a7869354..867c05fc1 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts @@ -38,7 +38,6 @@ import { checkUserCanTerminateOwnershipChange, doesChangeVideoOwnershipExist } f import { VideoChangeOwnershipAccept } from '../../../../shared/models/videos/video-change-ownership-accept.model' import { AccountModel } from '../../../models/account/account' import { isNSFWQueryValid, isNumberArray, isStringArray } from '../../../helpers/custom-validators/search' -import { getServerActor } from '../../../helpers/utils' import { CONFIG } from '../../../initializers/config' import { isLocalVideoAccepted } from '../../../lib/moderation' import { Hooks } from '../../../lib/plugins/hooks' @@ -50,6 +49,7 @@ import { } from '../../../helpers/middlewares' import { MVideoFullLight } from '@server/typings/models' import { getVideoWithAttributes } from '../../../helpers/video' +import { getServerActor } from '@server/models/application/application' const videosAddValidator = getCommonVideoEditAttributes().concat([ body('videofile') -- cgit v1.2.3