Skip to content

Commit

Permalink
set section.sln to 0 if the value is not valid
Browse files Browse the repository at this point in the history
  • Loading branch information
fanglinfang committed Jun 30, 2017
1 parent 4d0929b commit a54dd49
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion uw_sws/section.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,12 @@ def _json_to_section(section_data,
section.is_independent_study = False

section.class_website_url = section_data["ClassWebsiteUrl"]
section.sln = section_data["SLN"]

if is_valid_sln(section_data["SLN"]):
section.sln = section_data["SLN"]
else:
section.sln = 0

if "SummerTerm" in section_data:
section.summer_term = section_data["SummerTerm"]
else:
Expand Down

0 comments on commit a54dd49

Please sign in to comment.