Skip to content

Commit

Permalink
feat: add support for django4.2 & update lint (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
irtazaakram authored Feb 22, 2024
1 parent a118e35 commit 5f18e95
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 140 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [py38-django32]
toxenv: [py38-django32, py38-django42]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Python setup
uses: actions/setup-python@v4
Expand All @@ -37,7 +37,7 @@ jobs:
run: tox

- name: Upload coverage to CodeCov
if: matrix.python-version == '3.8' && matrix.toxenv == 'py38-django32'
if: matrix.python-version == '3.8' && matrix.toxenv == 'py38-django42'
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
Expand Down
5 changes: 5 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Release Notes
=============

Version 0.24.0 (Unreleased)
--------------

- feat: add support for Django 4.2

Version 0.23.1 (Released January 26, 2024)
--------------

Expand Down
13 changes: 2 additions & 11 deletions edx_sga/sga.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class StaffGradedAssignmentXBlock(
default=_("Staff Graded Assignment"),
scope=Scope.settings,
help=_(
"This name appears in the horizontal navigation at the top of " "the page."
"This name appears in the horizontal navigation at the top of the page."
),
)

Expand All @@ -119,7 +119,7 @@ class StaffGradedAssignmentXBlock(
staff_score = Integer(
display_name=_("Score assigned by non-instructor staff"),
help=_(
"Score will need to be approved by instructor before being " "published."
"Score will need to be approved by instructor before being published."
),
default=None,
scope=Scope.settings,
Expand Down Expand Up @@ -484,7 +484,6 @@ def prepare_download_submissions(
"""
Runs a async task that collects submissions in background and zip them.
"""
# pylint: disable=no-member
require(self.is_course_staff())
user = self.get_real_user()
require(user)
Expand Down Expand Up @@ -539,7 +538,6 @@ def download_submissions(
"""
Api for downloading zip file which consist of all students submissions.
"""
# pylint: disable=no-member
require(self.is_course_staff())
user = self.get_real_user()
require(user)
Expand Down Expand Up @@ -575,7 +573,6 @@ def download_submissions_status(
return Response(json_body={"zip_available": self.is_zip_file_available(user)})

def student_view(self, context=None):
# pylint: disable=no-member
"""
The primary view of the StaffGradedAssignmentXBlock, shown to students
when viewing courses.
Expand Down Expand Up @@ -727,7 +724,6 @@ def get_or_create_student_module(self, user):
Returns:
StudentModule: A StudentModule object
"""
# pylint: disable=no-member
student_module, created = StudentModule.objects.get_or_create(
course_id=self.course_id,
module_state_key=self.location,
Expand Down Expand Up @@ -772,7 +768,6 @@ def student_state(self):
solution = replace_urls_service.replace_urls(force_str(self.solution))
else:
solution = ""
# pylint: disable=no-member
return {
"display_name": force_str(self.display_name),
"uploaded": uploaded,
Expand Down Expand Up @@ -895,7 +890,6 @@ def download(self, path, mime_type, filename, require_staff=False):
def validate_score_message(
self, course_id, username
): # lint-amnesty, pylint: disable=missing-function-docstring
# pylint: disable=no-member
log.error(
"enter_grade: invalid grade submitted for course:%s module:%s student:%s",
course_id,
Expand Down Expand Up @@ -962,7 +956,6 @@ def upload_allowed(self, submission_data=None):
)

def file_storage_path(self, file_hash, original_filename):
# pylint: disable=no-member
"""
Helper method to get the path of an uploaded file
"""
Expand All @@ -972,7 +965,6 @@ def is_zip_file_available(self, user):
"""
returns True if zip file exists.
"""
# pylint: disable=no-member
zip_file_path = get_zip_file_path(
user.username, self.block_course_id, self.block_id, self.location
)
Expand All @@ -982,7 +974,6 @@ def count_archive_files(self, user):
"""
returns number of files archive in zip.
"""
# pylint: disable=no-member
zip_file_path = get_zip_file_path(
user.username, self.block_course_id, self.block_id, self.location
)
Expand Down
Loading

0 comments on commit 5f18e95

Please sign in to comment.