refactoring locales management
This commit is contained in:
@@ -272,12 +272,9 @@ const eventController = {
|
||||
// return created event to the client
|
||||
res.json(event)
|
||||
|
||||
// send notification (mastodon/email)
|
||||
// only if user is authenticated
|
||||
if (req.user && !event.recurrent) {
|
||||
const notifier = require('../../notifier')
|
||||
notifier.notifyEvent('Create', event.id)
|
||||
}
|
||||
// send notifications (mastodon / email)
|
||||
const notifier = require('../../notifier')
|
||||
notifier.notifyEvent('Create', event.id)
|
||||
} catch (e) {
|
||||
res.sendStatus(400)
|
||||
debug(e)
|
||||
|
||||
@@ -11,6 +11,7 @@ const generateKeyPair = util.promisify(crypto.generateKeyPair)
|
||||
|
||||
const defaultSettings = {
|
||||
instance_timezone: 'Europe/Rome',
|
||||
instance_locale: 'en',
|
||||
instance_name: config.title.toLowerCase().replace(/ /g, ''),
|
||||
allow_registration: true,
|
||||
allow_anon_event: true,
|
||||
|
||||
@@ -100,7 +100,7 @@ const userController = {
|
||||
const user = await User.create(req.body)
|
||||
debug(`Sending registration email to ${user.email}`)
|
||||
mail.send(user.email, 'register', { user, config }, req.settings.locale)
|
||||
mail.send(config.admin_email, 'admin_register', { user, config }, req.settings.locale)
|
||||
mail.send(config.admin_email, 'admin_register', { user, config })
|
||||
res.sendStatus(200)
|
||||
} catch (e) {
|
||||
res.status(404).json(e)
|
||||
|
||||
Reference in New Issue
Block a user