Current value on delete + no create without parent

This commit is contained in:
2018-07-21 17:39:26 +02:00
parent 9f275c76be
commit b5619c41eb
4 changed files with 33 additions and 11 deletions

View File

@@ -61,9 +61,12 @@ def handle_note(args, last_action, conn):
def create_note(note, active_project_id, active_task_id, conn):
# TODO Don't create note if no project (nothing selected?) ==> foreign key is not a solution: there is no project ID :)
logging.info(">> Create note")
if active_task_id == 0:
print("No task selected")
sys.exit(1)
query = """
INSERT INTO note (project_id, task_id, username, message)
VALUES (?, ?, ?, ?);