From 13e58d02fadd341f4661a269eef0155823d4d938 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Tue, 24 Sep 2024 13:55:11 -0400 Subject: [PATCH] fix: Don't import HttpClientError from edx-rest-api-client edx-rest-api-client was doing a wildcard import of the underlying Slumber exception. This wildcard impart has been droped in the latest release 6.0.0 This change updates the edx-enterprise code to not rely on this indirection to import the exception class. --- CHANGELOG.rst | 6 +++++- enterprise/__init__.py | 2 +- enterprise/api/v1/serializers.py | 2 +- enterprise/models.py | 2 +- enterprise/utils.py | 2 +- enterprise/views.py | 2 +- test_utils/fake_enrollment_api.py | 2 +- tests/test_admin/test_view.py | 2 +- .../views/test_grant_data_sharing_permissions.py | 2 +- tests/test_models.py | 2 +- 10 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4a60f4d661..3018d324ae 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,6 +17,10 @@ Unreleased ---------- * nothing unreleased +[4.25.14] +--------- +* fix: Don't import HttpClientError from edx-rest-api-client + [4.25.13] ---------- * feat: add logging to debug SAP SuccessFactors transmission issues @@ -257,7 +261,7 @@ Unreleased [4.20.7] -------- -* fix: add name from profile to group membership details +* fix: add name from profile to group membership details [4.20.6] -------- diff --git a/enterprise/__init__.py b/enterprise/__init__.py index e5d4c5cab2..d12a5ec336 100644 --- a/enterprise/__init__.py +++ b/enterprise/__init__.py @@ -2,4 +2,4 @@ Your project description goes here. """ -__version__ = "4.25.13" +__version__ = "4.25.14" diff --git a/enterprise/api/v1/serializers.py b/enterprise/api/v1/serializers.py index 36ffed6647..2215c9e54a 100644 --- a/enterprise/api/v1/serializers.py +++ b/enterprise/api/v1/serializers.py @@ -8,11 +8,11 @@ from collections.abc import Iterable import pytz -from edx_rest_api_client.exceptions import HttpClientError from oauth2_provider.generators import generate_client_id, generate_client_secret from rest_framework import serializers from rest_framework.fields import empty from rest_framework.settings import api_settings +from slumber.exceptions import HttpClientError from django.contrib import auth from django.contrib.sites.models import Site diff --git a/enterprise/models.py b/enterprise/models.py index 74d3b03a83..f9d241c4ce 100644 --- a/enterprise/models.py +++ b/enterprise/models.py @@ -13,13 +13,13 @@ from config_models.models import ConfigurationModel from django_countries.fields import CountryField from edx_rbac.models import UserRole, UserRoleAssignment -from edx_rest_api_client.exceptions import HttpClientError from fernet_fields import EncryptedCharField from jsonfield.encoder import JSONEncoder from jsonfield.fields import JSONField from multi_email_field.fields import MultiEmailField from requests.exceptions import HTTPError from simple_history.models import HistoricalRecords +from slumber.exceptions import HttpClientError from django.apps import apps from django.conf import settings diff --git a/enterprise/utils.py b/enterprise/utils.py index 5827147a09..b0e904abf7 100644 --- a/enterprise/utils.py +++ b/enterprise/utils.py @@ -15,7 +15,7 @@ import pytz from edx_django_utils.cache import TieredCache from edx_django_utils.cache import get_cache_key as get_django_cache_key -from edx_rest_api_client.exceptions import HttpClientError +from slumber.exceptions import HttpClientError from django.apps import apps from django.conf import settings diff --git a/enterprise/views.py b/enterprise/views.py index 2516c7e2cf..ef08a15d69 100644 --- a/enterprise/views.py +++ b/enterprise/views.py @@ -13,9 +13,9 @@ import waffle # pylint: disable=invalid-django-waffle-import from dateutil.parser import parse from edx_django_utils import monitoring -from edx_rest_api_client.exceptions import HttpClientError from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey +from slumber.exceptions import HttpClientError from django.apps import apps from django.conf import settings diff --git a/test_utils/fake_enrollment_api.py b/test_utils/fake_enrollment_api.py index 700cc31d38..185428ef1a 100644 --- a/test_utils/fake_enrollment_api.py +++ b/test_utils/fake_enrollment_api.py @@ -6,7 +6,7 @@ import json import re -from edx_rest_api_client.exceptions import HttpClientError +from slumber.exceptions import HttpClientError from django.conf import settings diff --git a/tests/test_admin/test_view.py b/tests/test_admin/test_view.py index 0932272ee9..128e241784 100644 --- a/tests/test_admin/test_view.py +++ b/tests/test_admin/test_view.py @@ -9,8 +9,8 @@ from urllib.parse import urlencode import ddt -from edx_rest_api_client.exceptions import HttpClientError from pytest import mark +from slumber.exceptions import HttpClientError from django.conf import settings from django.contrib import auth diff --git a/tests/test_enterprise/views/test_grant_data_sharing_permissions.py b/tests/test_enterprise/views/test_grant_data_sharing_permissions.py index 642a9bcd8e..cb97bcab46 100644 --- a/tests/test_enterprise/views/test_grant_data_sharing_permissions.py +++ b/tests/test_enterprise/views/test_grant_data_sharing_permissions.py @@ -8,8 +8,8 @@ import ddt from dateutil.parser import parse -from edx_rest_api_client.exceptions import HttpClientError from pytest import mark +from slumber.exceptions import HttpClientError from django.conf import settings from django.core.exceptions import ImproperlyConfigured diff --git a/tests/test_models.py b/tests/test_models.py index c665f010f6..0006081fcf 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -15,11 +15,11 @@ import ddt import responses -from edx_rest_api_client.exceptions import HttpClientError from faker import Factory as FakerFactory from freezegun.api import freeze_time from opaque_keys.edx.keys import CourseKey from pytest import mark, raises +from slumber.exceptions import HttpClientError from testfixtures import LogCapture from django.conf import settings