Skip to content

Commit

Permalink
type check for due_time as correct type
Browse files Browse the repository at this point in the history
  • Loading branch information
bachtran02 committed Feb 24, 2024
1 parent cf7b238 commit 7d1ee71
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import requests
from dotenv import load_dotenv
from datetime import datetime as dt

from gradescope.methods import get_courses, get_assignments

Expand All @@ -16,8 +17,10 @@

assignments = get_assignments(course['course_id'])
filtered = sorted(list(filter(
lambda x: x['is_submitted'] == False and
x['course_term'] == 'Spring 2024',
lambda x:
x['is_submitted'] == False and
x['course_term'] == 'Spring 2024' and
isinstance(x['due_time'], dt),
assignments)), key=lambda x: x['due_time'])

if not filtered:
Expand Down

0 comments on commit 7d1ee71

Please sign in to comment.