mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Fixing #1866
This commit is contained in:
parent
b92a029a04
commit
f7403a6b77
2 changed files with 5 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
c = require './../schemas'
|
||||
|
||||
patchables = ['level', 'thang_type', 'level_system', 'level_component', 'article']
|
||||
patchables = ['level', 'thang_type', 'level_system', 'level_component', 'article', 'achievement']
|
||||
|
||||
PatchSchema = c.object({title: 'Patch', required: ['target', 'delta', 'commitMessage']}, {
|
||||
delta: {title: 'Delta', type: ['array', 'object']}
|
||||
|
|
|
@ -140,9 +140,13 @@ module.exports = class I18NEditModelView extends RootView
|
|||
return _.isArray(delta.o) and delta.o.length is 1 and 'i18n' in delta.dataPath
|
||||
)
|
||||
|
||||
commitMessage = "Diplomat submission for lang #{@selectedLanguage}: #{flattened.length} change(s)."
|
||||
|
||||
if save
|
||||
modelToSave = @model.cloneNewMinorVersion()
|
||||
modelToSave.updateI18NCoverage() if modelToSave.get('i18nCoverage')
|
||||
if @modelClass.schema.properties.commitMessage
|
||||
modelToSave.set 'commitMessage', commitMessage
|
||||
|
||||
else
|
||||
modelToSave = new Patch()
|
||||
|
@ -151,9 +155,6 @@ module.exports = class I18NEditModelView extends RootView
|
|||
'collection': _.string.underscored @model.constructor.className
|
||||
'id': @model.id
|
||||
}
|
||||
|
||||
if @modelClass.schema.properties.commitMessage
|
||||
commitMessage = "Diplomat submission for lang #{@selectedLanguage}: #{flattened.length} change(s)."
|
||||
modelToSave.set 'commitMessage', commitMessage
|
||||
|
||||
errors = modelToSave.validate()
|
||||
|
|
Loading…
Reference in a new issue