Commit 6b9403a6 authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Add progress for actions creation on command

parent eeb72dc7
......@@ -26,6 +26,8 @@ class Command(BaseCommand):
# Create any missing Answer action
answers = Answer.objects.all().iterator()
total = len(Answer.objects.all())
count = 1
for answer in answers:
activity_id = answer.activity_id
......@@ -43,4 +45,6 @@ class Command(BaseCommand):
action_obj.timestamp = answer.timestamp
action_obj.save()
print("Creating action for answer id:", answer.id)
print("Creating action for answer id: {} --- Task progress: {}/{}".format(answer.id, count, total))
count += 1
......@@ -372,7 +372,7 @@ class UserAccessView(views.APIView):
if last_access_obj:
last_access = self.format_date(last_access_obj.timestamp)
if last_activity_obj:
last_completed_activity = self.format_date(last_completed_activity_obj.timestamp)
last_completed_activity = self.format_date(last_activity_obj.timestamp)
last_login = self.format_date(user.last_login)
time_delta = timezone.now() - timedelta(days=7)
......
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