Skip to content

Commit

Permalink
Fix fetch_degree Parsing Errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shiva-menta committed Oct 5, 2024
1 parent 00501b3 commit 5a92996
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/degree/utils/parse_degreeworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from django.db.models import Q

from courses.util import prettify_semester
from degree.models import Degree, Rule
from degree.utils.departments import ENG_DEPTS, SAS_DEPTS, WH_DEPTS

Expand Down Expand Up @@ -52,6 +53,8 @@ def parse_coursearray(courseArray) -> Q:
sub_q = Q(attributes__code__in=filter["valueList"])
case "DWTERM":
assert len(filter["valueList"]) == 1
if len(filter["valueList"][0].split()) == 1:
filter["valueList"][0] = prettify_semester(filter["valueList"][0][:-1])
semester, year = filter["valueList"][0].split()
match semester:
case "Spring":
Expand Down

0 comments on commit 5a92996

Please sign in to comment.