0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Added todo to users' schema to audit status field

no issue

- There is a valid subset of statuses that can be set for the users but there's no "isIn" validation for possible values
- Additionally some of the statuses like warn-1, warn-2, etc. don't have a clear usecase (or at least nothing was found in the codebase for them to be used). They might be up for removal if this assumption is correct
This commit is contained in:
Naz 2021-04-08 19:34:31 +12:00
parent 15b7485a94
commit e5b13ee5d2

View file

@ -90,6 +90,9 @@ module.exports = {
facebook: {type: 'string', maxlength: 2000, nullable: true},
twitter: {type: 'string', maxlength: 2000, nullable: true},
accessibility: {type: 'text', maxlength: 65535, nullable: true},
// TODO: would be good to add validation here to control for all possible status values.
// The ones that come up by reviewing the user model are:
// 'active', 'inactive', 'locked', 'warn-1', 'warn-2', 'warn-3', 'warn-4'
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'active'},
// NOTE: unused at the moment and reserved for future features
locale: {type: 'string', maxlength: 6, nullable: true},