Merge pull request #438 from crookedneighbor/prevent-type-changing

Prevent type changing
This commit is contained in:
Matteo Pagliazzi 2015-01-14 19:41:44 +01:00
commit ce1c0d9008
2 changed files with 6861 additions and 6894 deletions

13753
dist/habitrpg-shared.js vendored

File diff suppressed because it is too large Load diff

View file

@ -553,7 +553,7 @@ api.wrap = (user, main=true) ->
updateTask: (req, cb) ->
return cb?({code:404,message:i18n.t('messageTaskNotFound', req.language)}) unless task = user.tasks[req.params?.id]
_.merge task, _.omit(req.body,['checklist','id'])
_.merge task, _.omit(req.body,['checklist','id', 'type'])
task.checklist = req.body.checklist if req.body.checklist
task.markModified? 'tags'
cb? null, task