Commit 9c3c0fa8 authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Add skip for existent actions

parent 40492ba6
......@@ -22,16 +22,20 @@ class Command(BaseCommand):
def handle(self, *args, **options):
answered_actions_ids = Action.objects.filter(verb='answered').values_list('id', flat=True)
answered_actions_ids = Action.objects.filter(verb='answered').values_list('action_object_object_id', flat=True)
counter = 0
# Create any missing Answer action
for answer in Answer.objects.all():
answers = Answer.objects.all()
for answer in answers:
activity_id = answer.activity_id
user = answer.user
verb = 'answered'
#if in answered_actions_ids:
# continue
if str( in answered_actions_ids:
timesince = djtimesince(answer.timestamp).encode('utf8').replace(b'\xc2\xa0', b' ').decode('utf8')
Markdown is supported
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