]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/account/account.ts
Add user adminFlags
[github/Chocobozzz/PeerTube.git] / server / models / account / account.ts
index 3fb766c8a9772cc454f7ccdb83bfcec203a12638..6f425024e8a5164392032fb647dce67729b6d5d2 100644 (file)
@@ -10,7 +10,8 @@ import {
   ForeignKey,
   HasMany,
   Is,
-  Model, Scopes,
+  Model,
+  Scopes,
   Table,
   UpdatedAt
 } from 'sequelize-typescript'
@@ -24,10 +25,9 @@ import { getSort, throwIfNotValid } from '../utils'
 import { VideoChannelModel } from '../video/video-channel'
 import { VideoCommentModel } from '../video/video-comment'
 import { UserModel } from './user'
-import { CONFIG } from '../../initializers'
 import { AvatarModel } from '../avatar/avatar'
-import { WhereOptions } from 'sequelize'
 import { VideoPlaylistModel } from '../video/video-playlist'
+import { WEBSERVER } from '../../initializers/constants'
 
 export enum ScopeNames {
   SUMMARY = 'SUMMARY'
@@ -42,7 +42,7 @@ export enum ScopeNames {
   ]
 })
 @Scopes({
-  [ ScopeNames.SUMMARY ]: (whereActor?: WhereOptions<ActorModel>) => {
+  [ ScopeNames.SUMMARY ]: (whereActor?: Sequelize.WhereOptions<ActorModel>) => {
     return {
       attributes: [ 'id', 'name' ],
       include: [
@@ -199,7 +199,7 @@ export class AccountModel extends Model<AccountModel> {
   static loadByNameWithHost (nameWithHost: string) {
     const [ accountName, host ] = nameWithHost.split('@')
 
-    if (!host || host === CONFIG.WEBSERVER.HOST) return AccountModel.loadLocalByName(accountName)
+    if (!host || host === WEBSERVER.HOST) return AccountModel.loadLocalByName(accountName)
 
     return AccountModel.loadByNameAndHost(accountName, host)
   }