From 899e0f9353ca949ada62aaa9be2b44fe96f034df Mon Sep 17 00:00:00 2001 From: Adam Palay Date: Wed, 7 Jun 2017 17:09:56 -0400 Subject: [PATCH] aesthetic changes to command to mark old tasks as failures --- .../management/commands/fail_old_tasks.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lms/djangoapps/instructor_task/management/commands/fail_old_tasks.py b/lms/djangoapps/instructor_task/management/commands/fail_old_tasks.py index 8d5301731c..f3251e1aa5 100644 --- a/lms/djangoapps/instructor_task/management/commands/fail_old_tasks.py +++ b/lms/djangoapps/instructor_task/management/commands/fail_old_tasks.py @@ -91,7 +91,8 @@ class Command(BaseCommand): for task in tasks: print( - "Queueing task '{task_id}', of type '{task_type}', created on '{created}', will be marked as 'FAILURE'".format( + "{task_state} task '{task_id}', of type '{task_type}', created on '{created}', will be marked as 'FAILURE'".format( + task_state=task.task_state, task_id=task.task_id, task_type=task.task_type, created=task.created, @@ -103,7 +104,12 @@ class Command(BaseCommand): task_state=FAILURE, ) print("{tasks_updated} records updated.".format( - tasks_updated=tasks_updated) - ) + tasks_updated=tasks_updated + )) else: - print("This was a dry run, so no records were updated.") + print( + "This was a dry run, so no records were updated. " + "If this command were run for real, {number} records would have been updated.".format( + number=tasks.count() + ) + )