From b00ba4a96828206c35d37d734d228fd8e0293814 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 1 Jun 2016 08:16:39 +0200 Subject: [PATCH] Including created, modified and finished dates in tasks csv reports --- CHANGELOG.md | 1 + taiga/projects/tasks/services.py | 6 +++++- tests/integration/test_tasks.py | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97b090ff..3b1078c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Features - Now comment owners and project admins can edit existing comments with the history Entry endpoint. - Add a new permissions to allow add comments instead of use the existent modify permission for this purpose. +- Include created, modified and finished dates for tasks in CSV reports ### Misc - Lots of small and not so small bugfixes. diff --git a/taiga/projects/tasks/services.py b/taiga/projects/tasks/services.py index 98f9d4a1..427e4f28 100644 --- a/taiga/projects/tasks/services.py +++ b/taiga/projects/tasks/services.py @@ -99,7 +99,8 @@ def tasks_to_csv(project, queryset): fieldnames = ["ref", "subject", "description", "user_story", "sprint", "sprint_estimated_start", "sprint_estimated_finish", "owner", "owner_full_name", "assigned_to", "assigned_to_full_name", "status", "is_iocaine", "is_closed", "us_order", - "taskboard_order", "attachments", "external_reference", "tags", "watchers", "voters"] + "taskboard_order", "attachments", "external_reference", "tags", "watchers", "voters", + "created_date", "modified_date", "finished_date"] custom_attrs = project.taskcustomattributes.all() for custom_attr in custom_attrs: @@ -141,6 +142,9 @@ def tasks_to_csv(project, queryset): "tags": ",".join(task.tags or []), "watchers": task.watchers, "voters": task.total_voters, + "created_date": task.created_date, + "modified_date": task.modified_date, + "finished_date": task.finished_date, } for custom_attr in custom_attrs: value = task.custom_attributes_values.attributes_values.get(str(custom_attr.id), None) diff --git a/tests/integration/test_tasks.py b/tests/integration/test_tasks.py index 3323e84f..bb077c2f 100644 --- a/tests/integration/test_tasks.py +++ b/tests/integration/test_tasks.py @@ -177,6 +177,6 @@ def test_custom_fields_csv_generation(): data.seek(0) reader = csv.reader(data) row = next(reader) - assert row[21] == attr.name + assert row[24] == attr.name row = next(reader) - assert row[21] == "val1" + assert row[24] == "val1"