Skip to content

Commit

Permalink
fix: Added support for django42
Browse files Browse the repository at this point in the history
  • Loading branch information
zubairshakoorarbisoft committed Sep 15, 2023
1 parent 87be1f6 commit 95def90
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [django32, django40, quality, pii_check]
toxenv: [django32, django42, quality, pii_check]

steps:
- uses: actions/checkout@v2
Expand All @@ -38,7 +38,7 @@ jobs:
run: tox

- name: Run coverage
if: matrix.python-version == '3.8' && matrix.toxenv == 'django32'
if: matrix.python-version == '3.8' && matrix.toxenv == 'django42'
uses: codecov/codecov-action@v1
with:
flags: unittests
Expand Down
16 changes: 7 additions & 9 deletions edx_exams/apps/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
)


@admin.register(User)
class CustomUserAdmin(UserAdmin):
""" Admin configuration for the custom User model. """
list_display = ('username', 'email', 'full_name', 'first_name', 'last_name', 'is_staff')
Expand All @@ -29,13 +30,15 @@ class CustomUserAdmin(UserAdmin):
)


@admin.register(ProctoringProvider)
class ProctoringProviderAdmin(admin.ModelAdmin):
""" Admin configuration for the Proctoring Provider model """
list_display = ('name', 'verbose_name', 'lti_configuration_id')
search_fields = ('name', 'verbose_name', 'lti_configuration_id')
ordering = ('name',)


@admin.register(Exam)
class ExamAdmin(admin.ModelAdmin):
""" Admin configuration for the Exam model """
list_display = ('course_id', 'provider', 'exam_name', 'exam_type', 'due_date', 'is_active')
Expand All @@ -46,6 +49,7 @@ class ExamAdmin(admin.ModelAdmin):
ordering = ('-is_active', 'course_id', 'exam_name',)


@admin.register(ExamAttempt)
class ExamAttemptAdmin(admin.ModelAdmin):
""" Admin configuration for the Exam Attempt model """
list_display = ('user', 'exam', 'attempt_number', 'status', 'start_time',
Expand All @@ -63,6 +67,7 @@ def change_view(self, request, object_id, form_url='', extra_context=None):
)


@admin.register(CourseExamConfiguration)
class CourseExamConfigurationAdmin(admin.ModelAdmin):
""" Admin configuration for the Course Exam Configuration model """
list_display = ('course_id', 'provider', 'allow_opt_out')
Expand All @@ -71,6 +76,7 @@ class CourseExamConfigurationAdmin(admin.ModelAdmin):
ordering = ('course_id',)


@admin.register(AssessmentControlResult)
class AssessmentControlResultAdmin(admin.ModelAdmin):
""" Admin configuration for the AssessmentControlResult model """
list_display = ('get_username', 'get_course_id', 'get_exam_name')
Expand All @@ -87,18 +93,10 @@ def get_exam_name(self, obj):
return obj.attempt.exam.exam_name


@admin.register(CourseStaffRole)
class CourseStaffRoleAdmin(admin.ModelAdmin):
""" Admin configuration for the Course Staff Role model """
list_display = ('user', 'course_id')
list_filter = ('course_id',)
search_fields = ('user__username', 'course_id')
ordering = ('course_id',)


admin.site.register(User, CustomUserAdmin)
admin.site.register(ProctoringProvider, ProctoringProviderAdmin)
admin.site.register(Exam, ExamAdmin)
admin.site.register(ExamAttempt, ExamAttemptAdmin)
admin.site.register(CourseExamConfiguration, CourseExamConfigurationAdmin)
admin.site.register(AssessmentControlResult, AssessmentControlResultAdmin)
admin.site.register(CourseStaffRole, CourseStaffRoleAdmin)
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38-django{32,40}, quality, docs, pii_check
envlist = py38-django{32,42}, quality, docs, pii_check
skipsdist = true

[doc8]
Expand Down Expand Up @@ -44,7 +44,7 @@ filterwarnings =
[testenv]
deps =
django32: Django>=3.2,<4.0
django40: Django>=4.0,<4.1
django42: Django>=4.2,<4.3
-r{toxinidir}/requirements/test.txt
commands =
pytest {posargs}
Expand Down

0 comments on commit 95def90

Please sign in to comment.