Skip to content

Commit

Permalink
Merge pull request #192 from uw-it-aca/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jlaney authored Jan 19, 2023
2 parents 0964019 + 6c55903 commit 2d27dfa
Show file tree
Hide file tree
Showing 44 changed files with 88 additions and 71 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ on:

jobs:
test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.6
python-version: 3.8

- name: Install Dependencies
run: |
Expand Down Expand Up @@ -75,16 +75,16 @@ jobs:

needs: test

runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.x'
python-version: 3.8

- name: Publish to PyPi
uses: uw-it-aca/actions/publish-pypi@main
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

import json
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/adviser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

# Interfacing with the search for a student's academic advisers
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/campus.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

"""
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/college.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

"""
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/compat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

"""
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/course.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

"""
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/curriculum.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

"""
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/dao.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

"""
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/degree.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

# Interfacing with the search for a student's degree status
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/department.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

"""
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/enrollment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

"""
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from restclients_core.exceptions import DataFailureException
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/financial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

import logging
Expand Down
16 changes: 15 additions & 1 deletion uw_sws/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

import json
Expand Down Expand Up @@ -1371,6 +1371,20 @@ def has_unfinished_pce_course(self):
except AttributeError:
return False

def json_data(self):
data = {
'is_honors': self.is_honors,
'class_level': self.class_level,
'regid': self.regid,
'is_enroll_src_pce': self.is_enroll_src_pce,
'is_registered': self.is_registered,
'has_pending_major_change': self.has_pending_major_change
}
if self.registrations:
data['registrations'] = [registration.json_data()
for registration in self.registrations]
return data


class Major(models.Model):
degree_abbr = models.CharField(max_length=50)
Expand Down
4 changes: 2 additions & 2 deletions uw_sws/notice.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

"""
Expand Down Expand Up @@ -60,7 +60,7 @@ def _notices_from_json(notice_data):
attribute._string_value = notice_attrib.get("Value")
else:
logger.warn(
"Unkown attribute type: {}\nWith Value:{}".format(
"Unknown attribute type '{}', with value '{}'".format(
attribute.data_type,
notice_attrib.get("Value")))
continue
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/person.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

"""
Expand Down
23 changes: 5 additions & 18 deletions uw_sws/registration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

"""
Expand All @@ -12,13 +12,11 @@
from datetime import datetime
from uw_sws.models import Registration, RegistrationBlock, ClassSchedule
from restclients_core.exceptions import DataFailureException
from restclients_core.thread import (
Thread, GenericPrefetchThread, generic_prefetch)
from uw_sws import get_resource, put_resource, UWPWS
from uw_sws.person import get_person_by_regid
from restclients_core.thread import GenericPrefetchThread, generic_prefetch
from uw_sws import get_resource, put_resource
from uw_sws.exceptions import ThreadedDataError
from uw_sws.compat import deprecation
from uw_sws.thread import SWSThread
from uw_sws.thread import SWSCourseThread, SWSPersonByRegIDThread
from uw_sws.section import _json_to_section, get_prefetch_for_section_data


Expand All @@ -28,17 +26,6 @@
logger = logging.getLogger(__name__)


class SWSPersonByRegIDThread(Thread):
regid = None
person = None

def run(self):
if self.regid is None:
raise Exception("SWSPersonByRegIDThread must have a regid")

self.person = UWPWS.get_person_by_regid(self.regid)


def get_active_registrations_by_section(section, transcriptable_course=""):
"""
Returns a list of restclients.Registration objects, representing
Expand Down Expand Up @@ -238,7 +225,7 @@ def _json_to_stud_reg_schedule(json_data, term, regid,

try:
for registration in json_data["Registrations"]:
thread = SWSThread()
thread = SWSCourseThread()
thread.reg_json = registration
thread.url = registration["Section"]["Href"]
thread.headers = {"Accept": "application/json"}
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/section.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

"""
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/section_status.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from uw_sws.exceptions import InvalidSectionID
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/term.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

"""
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

# This is just a test runner for coverage
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/compatible.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_adviser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_campus.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_college.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_course.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_curriculum.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_dao.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_degree.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_department.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_enrollment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_financial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_independent_study.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_instructor_no_regid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_notice.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_person.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_registrations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_schedule_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_section.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from datetime import datetime, timedelta
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_section_status.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion uw_sws/tests/test_term.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 UW-IT, University of Washington
# Copyright 2023 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

import json
Expand Down
Loading

0 comments on commit 2d27dfa

Please sign in to comment.