I'll need to read into these functions; I had been using datetime.now() and
seeing the timezone using pytz but Dave had suggested this.


On Sat, Mar 29, 2014 at 11:19 AM, Will Daly <notifications@github.com>wrote:

> In apps/openassessment/assessment/peer_api.py:
>
> > @@ -78,9 +78,15 @@ class PeerAssessmentInternalError(PeerAssessmentError):
> >  def is_complete(submission_uuid, requirements):
> >      try:
> >          workflow = PeerWorkflow.objects.get(submission_uuid=submission_uuid)
> > +        if workflow.completed_at is not None:
> > +            return True
> > +        elif _num_peers_graded(workflow) >= requirements["must_grade"]:
> > +            workflow.completed_at = timezone.now()
>
> I'm a little concerned that this will return a naive datetime, which can
> sometimes happen depending on Django settings<https://docs.djangoproject.com/en/dev/ref/utils/#django.utils.timezone.now>.
> It might be safer to use datetime.now() instead and explicitly set the
> timezone to UTC, so we're guaranteed to have a TZ-aware datetime.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/edx/edx-ora2/pull/228/files#r11093722>
> .
>