mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-31 11:10:30 +00:00
handle _.where bug for corrupt tasks
This commit is contained in:
parent
3d76f11644
commit
8a606b627a
1 changed files with 2 additions and 1 deletions
|
|
@ -144,6 +144,7 @@ module.exports.updateUser = (batch) ->
|
|||
## Task List Cleanup
|
||||
# FIXME temporary hack to fix lists (Need to figure out why these are happening)
|
||||
tasks = obj.tasks
|
||||
tasks = _.reject tasks, (task) -> !task?
|
||||
_.each ['habit','daily','todo','reward'], (type) ->
|
||||
# 1. remove duplicates
|
||||
# 2. restore missing zombie tasks back into list
|
||||
|
|
@ -166,7 +167,7 @@ module.exports.BatchUpdate = BatchUpdate = (model) ->
|
|||
user: user
|
||||
|
||||
obj: ->
|
||||
obj ?= user.get()
|
||||
obj ?= model.get('users.'+user.get('id'), true)
|
||||
return obj
|
||||
|
||||
startTransaction: ->
|
||||
|
|
|
|||
Loading…
Reference in a new issue