1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Refactor email enabled function

This commit is contained in:
Chocobozzz 2020-02-17 10:27:00 +01:00
parent 45f1bd72a0
commit 4c1c170934
No known key found for this signature in database
GPG key ID: 583A612D890159BE
11 changed files with 37 additions and 47 deletions

View file

@ -5,9 +5,8 @@ import { isHostValid, isValidContactBody } from '../../helpers/custom-validators
import { ServerModel } from '../../models/server/server'
import { body } from 'express-validator'
import { isUserDisplayNameValid } from '../../helpers/custom-validators/users'
import { Emailer } from '../../lib/emailer'
import { Redis } from '../../lib/redis'
import { CONFIG } from '../../initializers/config'
import { CONFIG, isEmailEnabled } from '../../initializers/config'
const serverGetValidator = [
body('host').custom(isHostValid).withMessage('Should have a valid host'),
@ -50,7 +49,7 @@ const contactAdministratorValidator = [
.end()
}
if (Emailer.isEnabled() === false) {
if (isEmailEnabled() === false) {
return res
.status(409)
.send({ error: 'Emailer is not enabled on this instance.' })