Skip to content

Commit

Permalink
style: lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zawan-ila committed Jan 7, 2025
1 parent 7f58bef commit 70032cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions course_discovery/apps/course_metadata/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class Meta:
},
),
}

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if not self.instance.pk:
Expand Down
11 changes: 8 additions & 3 deletions course_discovery/apps/course_metadata/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
from course_discovery.apps.course_metadata.choices import ProgramStatus
from course_discovery.apps.course_metadata.constants import PathwayType
from course_discovery.apps.course_metadata.forms import PathwayAdminForm, ProgramAdminForm
from course_discovery.apps.course_metadata.models import CourseRunType, CourseType, Degree, Person, Position, Program, ProgramType, Source
from course_discovery.apps.course_metadata.models import (
CourseRunType, CourseType, Degree, Person, Position, Program, ProgramType, Source
)
from course_discovery.apps.course_metadata.tests import factories


Expand Down Expand Up @@ -234,8 +236,11 @@ def test_new_program_without_courses(self):
def test_retired_product_types_not_in_options(self, custom_settings, audit_in_options, type_model):
""" Verify that new objects (courses/courseruns) can not have a retired type"""
audit_type = type_model.objects.get(slug='audit')

url_name = 'admin:course_metadata_course_add' if type_model is CourseType else 'admin:course_metadata_courserun_add'
url_name = (
"admin:course_metadata_course_add"
if type_model is CourseType
else "admin:course_metadata_courserun_add"
)
url = reverse(url_name)
with override_settings(**custom_settings):
response = self.client.get(url)
Expand Down

0 comments on commit 70032cb

Please sign in to comment.