Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Fix a bug in task updates
Browse files Browse the repository at this point in the history
* Update docs
  • Loading branch information
tdemin committed Aug 9, 2019
1 parent 6a24bd8 commit 3459a39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions project_amber/helpers/task.py
Expand Up @@ -19,8 +19,8 @@ def addTask(text: str, status: int) -> int:

def getTask(task_id: int) -> Task:
"""
Returns an instance of `Task`, given the ID and the owner UID. If the UID
is `None`, returns the instance no matter who the owner is.
Returns an instance of `Task`, given the ID. Only returns tasks to
their owner.
"""
task_query = db.session.query(Task).filter_by(id=task_id)
task = task_query.filter_by(owner=request.user.id).one_or_none()
Expand All @@ -46,7 +46,7 @@ def updateChildren(task_id: int):
"""
task = getTask(task_id)
if not task.parent_id is None:
parent = getTask(None)
parent = getTask(task.parent_id)
task.gen = parent.gen + 1
else:
task.gen = 0
Expand Down

0 comments on commit 3459a39

Please sign in to comment.