mirror of
https://github.com/vale981/Vulcan
synced 2025-03-08 19:11:38 -05:00
limit autoValue to inserts
This commit is contained in:
parent
053183f5b5
commit
f2736c05c7
1 changed files with 4 additions and 3 deletions
|
@ -148,9 +148,10 @@ postSchemaObject = {
|
||||||
type: Number,
|
type: Number,
|
||||||
optional: true,
|
optional: true,
|
||||||
autoValue: function () {
|
autoValue: function () {
|
||||||
// only use this if status field is not set in the document being updated
|
// only provide a default value
|
||||||
// note: should we use defaultValue instead?
|
// 1) this is an insert operation
|
||||||
if(!this.isSet)
|
// 2) status field is not set in the document being inserted
|
||||||
|
if(this.isInsert && !this.isSet)
|
||||||
return getSetting('requirePostsApproval', false) ? STATUS_PENDING: STATUS_APPROVED
|
return getSetting('requirePostsApproval', false) ? STATUS_PENDING: STATUS_APPROVED
|
||||||
},
|
},
|
||||||
autoform: {
|
autoform: {
|
||||||
|
|
Loading…
Add table
Reference in a new issue