Skip to content

Commit 87bed67

Browse files
authored
Merge pull request #777 from UTDNebula/hot-fix-degree-year-choice
Hot fix, Check all the way back to 2022 for degree plans
2 parents 6324750 + 2da2d45 commit 87bed67

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

validator/degree_solver.py

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -191,27 +191,22 @@ def load_requirements(
191191
year = max([degree_requirements_input.year, 2022])
192192
if input_req not in degree_plans[str(year)]:
193193
# Check if the years before this one have it
194-
y = year
195-
while str(y := y - 1) in degree_plans:
194+
y = year - 1
195+
while y >= 2022:
196196
if input_req in degree_plans[str(y)]:
197197
year = y
198198
break
199-
if (
200-
year != degree_requirements_input.year
201-
): # The using_year has been replaced to a working year
202-
break
203-
# Check if the years after this one have it
204-
y = year
205-
while str(y := y + 1) in degree_plans:
206-
if input_req in degree_plans[str(y)]:
207-
year = y
208-
break
209-
if (
210-
year != degree_requirements_input.year
211-
): # The using_year has been replaced to a working year
212-
break
213-
print("Error: Could not find the degree")
214-
raise DegreeNotFoundException
199+
y = y - 1
200+
else:
201+
# Check if the years after this one have it
202+
y = year
203+
while str(y := y + 1) in degree_plans:
204+
if input_req in degree_plans[str(y)]:
205+
year = y
206+
break
207+
else:
208+
print("Error: Could not find the degree")
209+
raise DegreeNotFoundException
215210
requirements_data = degree_plans[str(year)][input_req]["requirements"][
216211
"major"
217212
]

0 commit comments

Comments
 (0)