Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #766 from akatsoulas/bug-968888
Browse files Browse the repository at this point in the history
[bug 968888] All events before the 16th of June have old metrics.
  • Loading branch information
akatsoulas committed Jun 5, 2014
2 parents ffc6b9b + 66d734a commit 0f76ecf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion remo/events/migrations/0016_tag_events_old_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
from django.db import models
from django.utils.timezone import now


class Migration(DataMigration):

def forwards(self, orm):
"""Do not force new metrics in past events."""
Event = orm['events.Event']
for event in Event.objects.filter(start__lt=now()):
events = Event.objects.filter(
start__lt=datetime.datetime(2014, 06, 16, 0, 0, 0))
for event in events:
event.has_new_metrics = False
event.save()

Expand Down

0 comments on commit 0f76ecf

Please sign in to comment.