Ajout et prise en compte d'une variable de configuration de l'instance, pour spécifier la valeur par défaut des jours de réception des envois/mail lors de la création d'un compte
This commit is contained in:
parent
176556fec2
commit
9d53778409
@ -16,6 +16,7 @@ module.exports =
|
|||||||
availableLangs: ["fr"],// Languages in which the site is available. The first one is the default one.
|
availableLangs: ["fr"],// Languages in which the site is available. The first one is the default one.
|
||||||
siteName: "WikiLerni",
|
siteName: "WikiLerni",
|
||||||
beginCodeGodfather: "WL", // case-sensitive and can't contain "@" !
|
beginCodeGodfather: "WL", // case-sensitive and can't contain "@" !
|
||||||
|
defaultReceiptDays: "1234567", // Par défaut, quel(s) jour(s) de la semaine, l'utilisateur reçoit-il quelque chose ? (1=dimanche, 2=lundi... 7=samedi)
|
||||||
cronTimingAlertInSeconde: 120, // for logs
|
cronTimingAlertInSeconde: 120, // for logs
|
||||||
responseTimingAlertInSeconde: 3, // idem
|
responseTimingAlertInSeconde: 3, // idem
|
||||||
tokenSignupValidationTimeInHours: "48h", // see : https://github.com/zeit/ms
|
tokenSignupValidationTimeInHours: "48h", // see : https://github.com/zeit/ms
|
||||||
|
@ -246,7 +246,7 @@ exports.signupValidation = async (req, res, next) =>
|
|||||||
{
|
{
|
||||||
const now=new Date();
|
const now=new Date();
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
db["Subscription"].create({ numberOfDays: config.freeAccountTimingInDays, noticeOk: datas.User.newsletterOk, UserId: datas.User.id }),
|
db["Subscription"].create({ numberOfDays: config.freeAccountTimingInDays, numberOfDays: config.defaultReceiptDays, noticeOk: datas.User.newsletterOk, UserId: datas.User.id }),
|
||||||
db["User"].update({ connectedAt: now }, { where: { id : datas.User.id }, limit:1 })
|
db["User"].update({ connectedAt: now }, { where: { id : datas.User.id }, limit:1 })
|
||||||
]);
|
]);
|
||||||
creaUserJson(datas.User.id);
|
creaUserJson(datas.User.id);
|
||||||
|
@ -27,7 +27,7 @@ module.exports = (sequelize, DataTypes) =>
|
|||||||
},
|
},
|
||||||
receiptDays:
|
receiptDays:
|
||||||
{
|
{
|
||||||
type: DataTypes.STRING(7), defaultValue: "23456", // revoir pour passer pour un paramètre de configuration ?
|
type: DataTypes.STRING(7), defaultValue: config.defaultReceiptDays,
|
||||||
comment: "Days on which the user has chosen to receive new questionnaires. The same numbers as in Mysql's DAYOFWEEK function.",
|
comment: "Days on which the user has chosen to receive new questionnaires. The same numbers as in Mysql's DAYOFWEEK function.",
|
||||||
set(value) { this.setDataValue("receiptDays", tool.trimIfNotNull(value)); },
|
set(value) { this.setDataValue("receiptDays", tool.trimIfNotNull(value)); },
|
||||||
validate:
|
validate:
|
||||||
|
Loading…
Reference in New Issue
Block a user