From 09ed4556e625115c494a9b84549eb2c8ac0b22fb Mon Sep 17 00:00:00 2001 From: Fang Lin Date: Mon, 31 Jul 2017 15:06:57 -0700 Subject: [PATCH 1/3] resolve MUWM-3897 --- myuw/dao/instructor_schedule.py | 14 +++++++++++--- ..._2013_future_terms_2_transcriptable_course_all} | 0 ..._2013_future_terms_2_transcriptable_course_all} | 0 ..._2013_future_terms_2_transcriptable_course_all} | 0 ..._2013_future_terms_2_transcriptable_course_all} | 0 ..._2013_future_terms_2_transcriptable_course_all} | 0 ..._2013_future_terms_2_transcriptable_course_all} | 0 ..._2013_future_terms_2_transcriptable_course_all} | 0 ..._2013_future_terms_2_transcriptable_course_all} | 0 ..._2013_future_terms_2_transcriptable_course_all} | 0 ..._2013_future_terms_2_transcriptable_course_all} | 12 ------------ ..._2013_future_terms_2_transcriptable_course_all} | 0 ..._2013_future_terms_2_transcriptable_course_all} | 0 myuw/test/dao/instructor_schedule.py | 3 +++ setup.py | 2 +- 15 files changed, 15 insertions(+), 16 deletions(-) rename myuw/resources/sws/file/student/v5/{section.json_reg_id_10000000000000000000000000000005_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all => section.json_reg_id_10000000000000000000000000000005_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all} (100%) rename myuw/resources/sws/file/student/v5/{section.json_reg_id_10000000000000000000000000000006_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all => section.json_reg_id_10000000000000000000000000000006_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all} (100%) rename myuw/resources/sws/file/student/v5/{section.json_reg_id_10000000000000000000000000000007_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all => section.json_reg_id_10000000000000000000000000000007_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all} (100%) rename myuw/resources/sws/file/student/v5/{section.json_reg_id_10000000000000000000000000000008_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all => section.json_reg_id_10000000000000000000000000000008_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all} (100%) rename myuw/resources/sws/file/student/v5/{section.json_reg_id_10000000000000000000000000000009_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all => section.json_reg_id_10000000000000000000000000000009_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all} (100%) rename myuw/resources/sws/file/student/v5/{section.json_reg_id_10000000000000000000000000000011_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all => section.json_reg_id_10000000000000000000000000000011_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all} (100%) rename myuw/resources/sws/file/student/v5/{section.json_reg_id_10000000000000000000000000000011_search_by_Instructor_quarter_summer_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all => section.json_reg_id_10000000000000000000000000000011_search_by_Instructor_quarter_summer_include_secondaries__year_2013_future_terms_2_transcriptable_course_all} (100%) rename myuw/resources/sws/file/student/v5/{section.json_reg_id_12345678901234567890123456789012_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all => section.json_reg_id_12345678901234567890123456789012_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all} (100%) rename myuw/resources/sws/file/student/v5/{section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494100_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all => section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494100_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all} (100%) rename myuw/resources/sws/file/student/v5/{section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all => section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all} (78%) rename myuw/resources/sws/file/student/v5/{section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_summer_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all => section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_summer_include_secondaries__year_2013_future_terms_2_transcriptable_course_all} (100%) rename myuw/resources/sws/file/student/v5/{section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_winter_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all => section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_winter_include_secondaries__year_2013_future_terms_2_transcriptable_course_all} (100%) diff --git a/myuw/dao/instructor_schedule.py b/myuw/dao/instructor_schedule.py index d7d60898f2..7c40548dcb 100644 --- a/myuw/dao/instructor_schedule.py +++ b/myuw/dao/instructor_schedule.py @@ -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='on'): """ @return a uw_sws.models.ClassSchedule object Return the actively enrolled sections for the current user @@ -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') @@ -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="") if len(sections) > 0: add_seen_instructor(user_netid, term) return True diff --git a/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000005_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all b/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000005_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all similarity index 100% rename from myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000005_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all rename to myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000005_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all diff --git a/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000006_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all b/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000006_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all similarity index 100% rename from myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000006_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all rename to myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000006_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all diff --git a/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000007_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all b/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000007_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all similarity index 100% rename from myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000007_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all rename to myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000007_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all diff --git a/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000008_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all b/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000008_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all similarity index 100% rename from myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000008_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all rename to myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000008_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all diff --git a/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000009_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all b/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000009_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all similarity index 100% rename from myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000009_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all rename to myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000009_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all diff --git a/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000011_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all b/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000011_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all similarity index 100% rename from myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000011_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all rename to myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000011_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all diff --git a/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000011_search_by_Instructor_quarter_summer_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all b/myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000011_search_by_Instructor_quarter_summer_include_secondaries__year_2013_future_terms_2_transcriptable_course_all similarity index 100% rename from myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000011_search_by_Instructor_quarter_summer_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all rename to myuw/resources/sws/file/student/v5/section.json_reg_id_10000000000000000000000000000011_search_by_Instructor_quarter_summer_include_secondaries__year_2013_future_terms_2_transcriptable_course_all diff --git a/myuw/resources/sws/file/student/v5/section.json_reg_id_12345678901234567890123456789012_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all b/myuw/resources/sws/file/student/v5/section.json_reg_id_12345678901234567890123456789012_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all similarity index 100% rename from myuw/resources/sws/file/student/v5/section.json_reg_id_12345678901234567890123456789012_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all rename to myuw/resources/sws/file/student/v5/section.json_reg_id_12345678901234567890123456789012_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all diff --git a/myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494100_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all b/myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494100_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all similarity index 100% rename from myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494100_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all rename to myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494100_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all diff --git a/myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all b/myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all similarity index 78% rename from myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all rename to myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all index b8d0d5fd90..86d4a6e3cf 100644 --- a/myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_spring_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all +++ b/myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_spring_include_secondaries__year_2013_future_terms_2_transcriptable_course_all @@ -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", diff --git a/myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_summer_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all b/myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_summer_include_secondaries__year_2013_future_terms_2_transcriptable_course_all similarity index 100% rename from myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_summer_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all rename to myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_summer_include_secondaries__year_2013_future_terms_2_transcriptable_course_all diff --git a/myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_winter_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all b/myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_winter_include_secondaries__year_2013_future_terms_2_transcriptable_course_all similarity index 100% rename from myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_winter_include_secondaries_on_year_2013_future_terms_2_transcriptable_course_all rename to myuw/resources/sws/file/student/v5/section.json_reg_id_FBB38FE46A7C11D5A4AE0004AC494FFE_search_by_Instructor_quarter_winter_include_secondaries__year_2013_future_terms_2_transcriptable_course_all diff --git a/myuw/test/dao/instructor_schedule.py b/myuw/test/dao/instructor_schedule.py index 4f13ff0d7f..67a547fc82 100644 --- a/myuw/test/dao/instructor_schedule.py +++ b/myuw/test/dao/instructor_schedule.py @@ -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) diff --git a/setup.py b/setup.py index ca3ae38c7a..89268968cf 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ 'unittest2', 'AuthZ-Group', 'python-binary-memcached', - 'UW-RestClients-SWS<2.0,>=1.3', + 'UW-RestClients-SWS<2.0,>=1.3.1', 'UW-RestClients-PWS<1.0', 'UW-RestClients-HFS<1.0', 'UW-RestClients-GWS<1.0', From b2e39cc8cc329c8adec8bf12a1e9fb1bc16dd1da Mon Sep 17 00:00:00 2001 From: Fang Lin Date: Mon, 31 Jul 2017 15:55:05 -0700 Subject: [PATCH 2/3] update sws version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 89268968cf..a23738fb3c 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ 'unittest2', 'AuthZ-Group', 'python-binary-memcached', - 'UW-RestClients-SWS<2.0,>=1.3.1', + 'UW-RestClients-SWS<2.0,>=1.4', 'UW-RestClients-PWS<1.0', 'UW-RestClients-HFS<1.0', 'UW-RestClients-GWS<1.0', From 6fe4a20c88a0838fc53e6afff76ab067bcae7524 Mon Sep 17 00:00:00 2001 From: Fang Lin Date: Mon, 31 Jul 2017 16:07:36 -0700 Subject: [PATCH 3/3] udpate for uw_sws 1.4 --- myuw/dao/instructor_schedule.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/myuw/dao/instructor_schedule.py b/myuw/dao/instructor_schedule.py index 7c40548dcb..ffacf37a33 100644 --- a/myuw/dao/instructor_schedule.py +++ b/myuw/dao/instructor_schedule.py @@ -24,7 +24,7 @@ def _get_instructor_sections(person, term, future_terms=0, - include_secondaries='on'): + include_secondaries=True): """ @return a uw_sws.models.ClassSchedule object Return the actively enrolled sections for the current user @@ -172,7 +172,7 @@ def is_instructor(request): sections = _get_instructor_sections(person, term, future_terms=2, - include_secondaries="") + include_secondaries=False) if len(sections) > 0: add_seen_instructor(user_netid, term) return True