That's a good point; I imagine that was actually *the* point of this.


On Wed, Jun 4, 2014 at 9:32 AM, Will Daly <notifications@github.com> wrote:

> In apps/openassessment/assessment/models/ai.py:
>
> > @@ -336,13 +344,72 @@ def get_incomplete_workflows(cls, course_id, item_id):
> >          for workflow_uuid in grade_workflow_uuids:
> >
> >              # Returns the grading workflow associated with the uuid stored in the initial query
> > -            try:
> > -                grading_workflow = cls.objects.get(uuid=workflow_uuid)
> > -                yield grading_workflow
> > -            except (cls.DoesNotExist, ObjectDoesNotExist, DatabaseError) as ex:
> > -                msg = u"No workflow with uuid '{}' could be found within the system.".format(workflow_uuid)
> > -                logger.exception(msg)
> > -                raise AIError(ex)
> > +            workflow = cls.objects.get(uuid=workflow_uuid)
>
> Django won't turn this into one query, but I actually don't think we want
> it to, because we might end up retrieving tons of workflows at once.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/edx/edx-ora2/pull/397/files#r13385596>.
>