Skip to content

Commit

Permalink
more precise pattern match condition
Browse files Browse the repository at this point in the history
  • Loading branch information
fanglinfang committed Apr 19, 2017
1 parent 6309aeb commit e311c84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions uw_sws/section.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@


def validate_section_label(label):
if label is None or not section_label_pattern.match(label):
if label is None or section_label_pattern.match(label) is None:
raise InvalidSectionID("Invalid section label: %s" % label)


def is_valid_sln(sln_str):
return sln_str is not None and sln_pattern.match(sln_str)
return not (sln_str is None or sln_pattern.match(sln_str) is None)


def get_sections_by_instructor_and_term(person, term):
Expand Down

0 comments on commit e311c84

Please sign in to comment.