Commit 86fed13b authored by Laurent Peuch's avatar Laurent Peuch
Browse files

[mod] production config: work on data of yesterday

parent 8414e1c5
......@@ -38,19 +38,16 @@ class Command(BaseCommand):
today = date.today()
yesterday = today - timedelta(days=1)
# modified_yesterday_members = Member.objects.filter(last_modified__lt=date.today(), last_modified__gt=yesterday)
modified_yesterday_members = Member.objects.filter(last_modified__gt=date.today())
modified_yesterday_members = Member.objects.filter(last_modified__lt=date.today(), last_modified__gt=yesterday)
for member_revisions in map(reversion.get_for_object, modified_yesterday_members):
member_revisions = list(member_revisions.get_unique())
# yesterday_modifications = filter(lambda x: x.field_dict["last_modified"].date() == yesterday, member_revisions)
yesterday_modifications = filter(lambda x: x.field_dict["last_modified"].date() == today, member_revisions)
yesterday_modifications = filter(lambda x: x.field_dict["last_modified"].date() == yesterday, member_revisions)
users_that_has_modified_the_documented = u", ".join(set(map(lambda x: unicode(x.revision.user), yesterday_modifications)))
# older_modifications = filter(lambda x: x.field_dict["last_modified"].date() < yesterday, member_revisions)
older_modifications = filter(lambda x: x.field_dict["last_modified"].date() < today, member_revisions)
older_modifications = filter(lambda x: x.field_dict["last_modified"].date() < yesterday, member_revisions)
if not older_modifications:
data["created"].append([yesterday_modifications[0], users_that_has_modified_the_documented])
else:
......
Supports Markdown
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