diff --git a/enterprise/models.py b/enterprise/models.py index 69eb4d5db..9d0748c7c 100644 --- a/enterprise/models.py +++ b/enterprise/models.py @@ -2593,7 +2593,7 @@ def determine_content_type(self): Determines the content_type for a given content_key by validating the return value from `content_metadata_for_content_key`. First determines if the configured content_key matches the returned key, then checks if it matches any of the returned course runs. - + Returns either COURSE, COURSE_RUN, or None (if neither can be determined). """ if not (content_metadata := self.content_metadata_for_content_key): @@ -2632,10 +2632,10 @@ def clean(self): args=[existing_record.uuid], ) message = _( - f'A default enrollment intention with this enterprise customer and ' - f'content key already exists, but is soft-deleted. Please restore ' - f'it here.', - ) + 'A default enrollment intention with this enterprise customer and ' + 'content key already exists, but is soft-deleted. Please restore ' + 'it here.', + ).format(existing_record_admin_url=existing_record_admin_url) raise ValidationError({ 'content_key': mark_safe(message) }) diff --git a/tests/test_models.py b/tests/test_models.py index 1b9b5f23d..1e9962327 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -19,9 +19,9 @@ from freezegun.api import freeze_time from opaque_keys.edx.keys import CourseKey from pytest import mark, raises +from requests.exceptions import HTTPError from slumber.exceptions import HttpClientError from testfixtures import LogCapture -from requests.exceptions import HTTPError from django.conf import settings from django.core.exceptions import ValidationError