Fixed the consent so now it requires it all the time
This commit is contained in:
@ -20,7 +20,8 @@ async def init_db():
|
||||
deadline TEXT,
|
||||
status TEXT,
|
||||
priority TEXT,
|
||||
FOREIGN KEY(project_id) REFERENCES projects(id))'''
|
||||
FOREIGN KEY(project_id) REFERENCES projects(id))
|
||||
'''
|
||||
)
|
||||
await db.execute(
|
||||
'''CREATE TABLE IF NOT EXISTS user_consents(
|
||||
@ -48,20 +49,20 @@ async def get_project_name(project_id):
|
||||
result = await cursor.fetchone()
|
||||
return result[0] if result else None
|
||||
|
||||
async def add_task_to_project(project_id, description, assignee, deadline, status, priority):
|
||||
async def add_task_to_project(project_id, description, assignee, deadline, status, priority, reminder_time=None):
|
||||
async with aiosqlite.connect(DATABASE) as db:
|
||||
# Change the date format to MM/DD/YYYY
|
||||
deadline_date = datetime.strptime(deadline, "%m/%d/%Y").date()
|
||||
await db.execute("INSERT INTO tasks(project_id, description, assignee, deadline, status, priority) VALUES(?, ?, ?, ?, ?, ?)",
|
||||
(project_id, description, assignee, deadline_date, status, priority))
|
||||
await db.execute(
|
||||
"INSERT INTO tasks (project_id, description, assignee, deadline, status, priority, reminder_time) VALUES (?, ?, ?, ?, ?, ?, ?)",
|
||||
(project_id, description, assignee, deadline, status, priority, reminder_time)
|
||||
)
|
||||
await db.commit()
|
||||
|
||||
async def update_task(task_id, description, assignee, deadline, status, priority):
|
||||
async def update_task(task_id, description, assignee, deadline, status, priority, reminder_time=None):
|
||||
async with aiosqlite.connect(DATABASE) as db:
|
||||
# Change the date format to MM/DD/YYYY
|
||||
deadline_date = datetime.strptime(deadline, "%m/%d/%Y").date()
|
||||
await db.execute("UPDATE tasks SET description=?, assignee=?, deadline=?, status=?, priority=? WHERE id=?",
|
||||
(description, assignee, deadline_date, status, priority, task_id))
|
||||
await db.execute(
|
||||
"UPDATE tasks SET description=?, assignee=?, deadline=?, status=?, priority=?, reminder_time=? WHERE id=?",
|
||||
(description, assignee, deadline, status, priority, reminder_time, task_id)
|
||||
)
|
||||
await db.commit()
|
||||
|
||||
async def list_projects():
|
||||
|
Reference in New Issue
Block a user