undo commit 669181239d8e0557b3bc632db91570b53f919e58, hide empty (deleted) tasks in ls function instead
This commit is contained in:
parent
5892e80e2e
commit
c08281b83a
@ -30,6 +30,9 @@ def ls(update, context):
|
|||||||
tasks = db.get_all_user_tasks(update.effective_user)
|
tasks = db.get_all_user_tasks(update.effective_user)
|
||||||
r = ""
|
r = ""
|
||||||
for task in tasks:
|
for task in tasks:
|
||||||
|
if str(task) == "":
|
||||||
|
continue
|
||||||
|
|
||||||
if task.done is ('done' in update.message['text']) or ('all' in update.message['text']):
|
if task.done is ('done' in update.message['text']) or ('all' in update.message['text']):
|
||||||
r+= f"{task.id} {str(task)}"
|
r+= f"{task.id} {str(task)}"
|
||||||
r+= '\n'
|
r+= '\n'
|
||||||
|
@ -34,8 +34,6 @@ def get_all_user_tasks(user) -> "list of pydo.Task":
|
|||||||
r = []
|
r = []
|
||||||
|
|
||||||
for id, task_str in enumerate(task_list):
|
for id, task_str in enumerate(task_list):
|
||||||
if task_str == '':
|
|
||||||
continue
|
|
||||||
task = pydo.Task(task_str)
|
task = pydo.Task(task_str)
|
||||||
task.id = id
|
task.id = id
|
||||||
r.append(task)
|
r.append(task)
|
||||||
|
Reference in New Issue
Block a user