Commit 0f12fc0a by Eric Fischer

quality cleanup

parent 8a5edabf
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# pylint: skip-file
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# pylint: skip-file
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# pylint: skip-file
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
......
...@@ -414,6 +414,7 @@ class AIClassifierSet(models.Model): ...@@ -414,6 +414,7 @@ class AIClassifierSet(models.Model):
# an AWS S3 bucket. # an AWS S3 bucket.
AI_CLASSIFIER_STORAGE = "ora2_ai_classifiers" AI_CLASSIFIER_STORAGE = "ora2_ai_classifiers"
def upload_to_path(instance, filename): # pylint:disable=W0613 def upload_to_path(instance, filename): # pylint:disable=W0613
""" """
Calculate the file path where classifiers should be uploaded. Calculate the file path where classifiers should be uploaded.
......
...@@ -790,7 +790,6 @@ class AssessmentPart(models.Model): ...@@ -790,7 +790,6 @@ class AssessmentPart(models.Model):
msg = u"Missing selections for criteria: {missing}".format(missing=missing_criteria) msg = u"Missing selections for criteria: {missing}".format(missing=missing_criteria)
raise InvalidRubricSelection(msg) raise InvalidRubricSelection(msg)
@classmethod @classmethod
def _check_all_criteria_assessed(cls, rubric_index, selected_criteria, criteria_feedback): def _check_all_criteria_assessed(cls, rubric_index, selected_criteria, criteria_feedback):
""" """
......
...@@ -341,9 +341,10 @@ class PeerWorkflow(models.Model): ...@@ -341,9 +341,10 @@ class PeerWorkflow(models.Model):
"and student_id<>%s " "and student_id<>%s "
"and pw.cancelled_at is NULL " "and pw.cancelled_at is NULL "
"and pw.id not in ( " "and pw.id not in ( "
"select pwi.author_id " "select pwi.author_id "
"from assessment_peerworkflowitem pwi " "from assessment_peerworkflowitem pwi "
"where pwi.scorer_id=%s); ", "where pwi.scorer_id=%s"
"); ",
[self.course_id, self.item_id, self.student_id, self.id] [self.course_id, self.item_id, self.student_id, self.id]
)) ))
workflow_count = len(query) workflow_count = len(query)
...@@ -379,7 +380,9 @@ class PeerWorkflow(models.Model): ...@@ -379,7 +380,9 @@ class PeerWorkflow(models.Model):
""" """
try: try:
item_query = self.graded.filter(submission_uuid=submission_uuid).order_by("-started_at", "-id") # pylint:disable=E1101 item_query = self.graded.filter(
submission_uuid=submission_uuid
).order_by("-started_at", "-id") # pylint:disable=E1101
items = list(item_query[:1]) items = list(item_query[:1])
if not items: if not items:
msg = ( msg = (
...@@ -391,8 +394,10 @@ class PeerWorkflow(models.Model): ...@@ -391,8 +394,10 @@ class PeerWorkflow(models.Model):
item.assessment = assessment item.assessment = assessment
item.save() item.save()
if (not item.author.grading_completed_at if (
and item.author.graded_by.filter(assessment__isnull=False).count() >= num_required_grades): not item.author.grading_completed_at and
item.author.graded_by.filter(assessment__isnull=False).count() >= num_required_grades
):
item.author.grading_completed_at = now() item.author.grading_completed_at = now()
item.author.save() item.author.save()
except (DatabaseError, PeerWorkflowItem.DoesNotExist): except (DatabaseError, PeerWorkflowItem.DoesNotExist):
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# pylint: skip-file
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment