mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 18:11:40 -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,
|
||||
optional: true,
|
||||
autoValue: function () {
|
||||
// only use this if status field is not set in the document being updated
|
||||
// note: should we use defaultValue instead?
|
||||
if(!this.isSet)
|
||||
// only provide a default value
|
||||
// 1) this is an insert operation
|
||||
// 2) status field is not set in the document being inserted
|
||||
if(this.isInsert && !this.isSet)
|
||||
return getSetting('requirePostsApproval', false) ? STATUS_PENDING: STATUS_APPROVED
|
||||
},
|
||||
autoform: {
|
||||
|
|
Loading…
Add table
Reference in a new issue