Skip to content

Commit

Permalink
Merge pull request #818 from uw-it-aca/hotfix/MUWM-3897
Browse files Browse the repository at this point in the history
Hotfix/muwm 3897
  • Loading branch information
fanglinfang authored Jul 31, 2017
2 parents f663d78 + 6fe4a20 commit 02b20fb
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 16 deletions.
14 changes: 11 additions & 3 deletions myuw/dao/instructor_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
logger = logging.getLogger(__name__)


def _get_instructor_sections(person, term, future_terms=0):
def _get_instructor_sections(person, term,
future_terms=0,
include_secondaries=True):
"""
@return a uw_sws.models.ClassSchedule object
Return the actively enrolled sections for the current user
Expand All @@ -31,7 +33,10 @@ def _get_instructor_sections(person, term, future_terms=0):
if person is None or term is None:
return None
return get_sections_by_instructor_and_term(
person, term, future_terms=future_terms,
person,
term,
future_terms=future_terms,
include_secondaries=include_secondaries,
transcriptable_course='all')


Expand Down Expand Up @@ -164,7 +169,10 @@ def is_instructor(request):
return True

person = get_person_of_current_user()
sections = _get_instructor_sections(person, term, future_terms=2)
sections = _get_instructor_sections(person,
term,
future_terms=2,
include_secondaries=False)
if len(sections) > 0:
add_seen_instructor(user_netid, term)
return True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@
"SectionID":"A",
"Year":"2013"},
{"Href":"\/student\/v5\/course\/2013,spring,PHYS,121\/A.json",
"CourseNumber":"121",
"CurriculumAbbreviation":"PHYS",
"Quarter":"spring",
"SectionID":"A",
"Year":"2013"},
{"Href":"\/student\/v5\/course\/2013,spring,PHYS,121\/AC.json",
"CourseNumber":"121",
"CurriculumAbbreviation":"PHYS",
"Quarter":"spring",
"SectionID":"A",
"Year":"2013"},
{"Href":"\/student\/v5\/course\/2013,spring,PHYS,121\/AQ.json",
"CourseNumber":"121",
"CurriculumAbbreviation":"PHYS",
"Quarter":"spring",
Expand Down
3 changes: 3 additions & 0 deletions myuw/test/dao/instructor_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def test_is_instructor(self):
get_request_with_user('bill', now_request)
self.assertTrue(is_instructor(now_request))

get_request_with_user('billpce', now_request)
self.assertTrue(is_instructor(now_request))

def test_get_current_quarter_instructor_schedule(self):
now_request = get_request()
get_request_with_user('bill', now_request)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
'unittest2',
'AuthZ-Group',
'python-binary-memcached',
'UW-RestClients-SWS<2.0,>=1.3',
'UW-RestClients-SWS<2.0,>=1.4',
'UW-RestClients-PWS<1.0',
'UW-RestClients-HFS<1.0',
'UW-RestClients-GWS<1.0',
Expand Down

0 comments on commit 02b20fb

Please sign in to comment.