hw_todo/tests/SpyRoutes.py
def canvas():
    """
    (GET)
    Updates the database with all new assignments from Canvas LMS 
    """
    tasks = get_canvas_tasks()
    for task in tasks:
        if not check_if_exists(task['canvas_id']):

            try:
                # new_task = Todo(assignment=task['assignment'], due_date=task['due_date'], course=task['course'],
                #                 canvas_id=task['canvas_id'])

                db_canvas["Tasks"].append({
                    "Assignment": task['assignment'],
                    "Due Date": task['due_date'],
                    "Course": task['course'],
                    "Canvas ID": task['canvas_id'],
                    "Completed": False,
                    "Pending": False
                })
            except Exception as e:
                print(e)
                return 'There was an issue pulling your tasks from canvas'

    return db_canvas

    (GET)
    Updates the database with all new assignments from Canvas LMS 
    
(GET)
Updates the database with all new assignments from Canvas LMS
( GET ) Updates the database with all new assignments from Canvas LMS
def canvas():
    tasks = get_canvas_tasks()
    for task in tasks:
        if not check_if_exists(task['canvas_id']):
            try:
                db_canvas["Tasks"].append({
                    "Assignment": task['assignment'],
                    "Due Date": task['due_date'],
                    "Course": task['course'],
                    "Canvas ID": task['canvas_id'],
                    "Completed": False,
                    "Pending": False
                })
            except Exception as e:
                print(e)
                return 'There was an issue pulling your tasks from canvas'
    return db_canvas
def canvas ( ) : tasks = get_canvas_tasks ( ) for task in tasks : if not check_if_exists ( task [ 'canvas_id' ] ) : try : db_canvas [ "Tasks" ] . append ( { "Assignment" : task [ 'assignment' ] , "Due Date" : task [ 'due_date' ] , "Course" : task [ 'course' ] , "Canvas ID" : task [ 'canvas_id' ] , "Completed" : False , "Pending" : False } ) except Exception as e : print ( e ) return 'There was an issue pulling your tasks from canvas' return db_canvas
(GET)
Updates the database with all new assignments from Canvas LMS
( GET ) Updates the database with all new assignments from Canvas LMS
"""
    (GET)
    Updates the database with all new assignments from Canvas LMS 
    """ # new_task = Todo(assignment=task['assignment'], due_date=task['due_date'], course=task['course'], #                 canvas_id=task['canvas_id'])