Fixing clear_unnecessary_new_membership_entries manage command

remotes/origin/enhancement/email-actions
Alejandro Alonso 2015-06-11 11:32:25 +02:00
parent cfdb0c1280
commit 1f7ca6cb97
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ class Command(BaseCommand):
removing_timeline_ids = [] removing_timeline_ids = []
for t in Timeline.objects.filter(event_type="projects.membership.create").order_by("created"): for t in Timeline.objects.filter(event_type="projects.membership.create").order_by("created"):
print(t.created) print(t.created)
if t.project.owner.id == t.data["user"]["id"]: if t.project.owner.id == t.data["user"].get("id", None):
removing_timeline_ids.append(t.id) removing_timeline_ids.append(t.id)
Timeline.objects.filter(id__in=removing_timeline_ids).delete() Timeline.objects.filter(id__in=removing_timeline_ids).delete()