Skip to content

Commit

Permalink
Use timezone.now().
Browse files Browse the repository at this point in the history
  • Loading branch information
thesealion committed Feb 28, 2014
1 parent 5116365 commit e13340e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/cabotapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from .graphite import get_data, get_matching_metrics
from .alert import telephone_alert_twiml_callback
from django.contrib.auth.models import User
from django.utils import timezone
from django.utils.timezone import utc
from django.core.urlresolvers import reverse
from django.core.exceptions import ValidationError
Expand Down Expand Up @@ -267,7 +268,7 @@ def get_report(self):
).order_by('time')
groups = dropwhile(lambda item: item[0], groupby(results, key=lambda r: r.succeeded))
times = [next(group).time for succeeded, group in groups]
pairs = izip_longest(*([iter(times)] * 2), fillvalue=datetime.now())
pairs = izip_longest(*([iter(times)] * 2), fillvalue=timezone.now())
check.problems = [(start, end - start) for start, end in pairs]
if results:
check.success_rate = results.filter(succeeded=True).count() / float(len(results)) * 100
Expand Down

0 comments on commit e13340e

Please sign in to comment.