Skip to content

Commit

Permalink
fix: pylint issues reported by ci
Browse files Browse the repository at this point in the history
[E0606(possibly-used-before-assignment), TeamMixin.add_team_submission_context] Possibly using variable team_submission before assignment

[E0606(possibly-used-before-assignment), serialize_training_examples] Possibly using variable parts before assignment

[E0606(possibly-used-before-assignment), StaffWorkflowListViewUnitTests.test_bulk_fetch_annotated_staff_workflows] Possibly using variable assessment_ids before assignment
  • Loading branch information
shadinaif committed Jul 26, 2024
1 parent 9cf4b5b commit 8fd1c39
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ def assert_annotated_staff_workflow_equal(self, expected, actual, i):
@freeze_time(TEST_START_DATE)
def test_bulk_fetch_annotated_staff_workflows(self, xblock, set_up_grades, set_up_locks):
""" Unit test for bulk_fetch_annotated_staff_workflows """
assessment_ids = None
if set_up_grades:
# If we are grading, student_0 graded by staff_1, student_1 ungraded,
# student_2 graded by staff_0, student_3 by staff_1
Expand Down
2 changes: 1 addition & 1 deletion openassessment/xblock/team_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def add_team_submission_context(
raise TypeError("One of team_submission_uuid or individual_submission_uuid must be provided")
if team_submission_uuid:
team_submission = get_team_submission(team_submission_uuid)
elif individual_submission_uuid:
else:
team_submission = get_team_submission_from_individual_submission(individual_submission_uuid)

team = self.teams_service.get_team_by_team_id(team_submission['team_id'])
Expand Down
1 change: 1 addition & 0 deletions openassessment/xblock/utils/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ def serialize_training_examples(examples, assessment_el):
answer_el = etree.SubElement(example_el, 'answer')
try:
answer = example_dict.get('answer')
parts = []
if answer is None:
parts = []
elif isinstance(answer, dict):
Expand Down

0 comments on commit 8fd1c39

Please sign in to comment.