diff --git a/taiga/projects/fixtures/initial_project_templates.json b/taiga/projects/fixtures/initial_project_templates.json index 7d84b49f..b787f7e9 100644 --- a/taiga/projects/fixtures/initial_project_templates.json +++ b/taiga/projects/fixtures/initial_project_templates.json @@ -21,6 +21,7 @@ "points": "?", "priority": "Normal", "us_status": "New", + "us_duedate": "Default", "issue_type": "Bug", "epic_status": "New", "severity": "Normal", @@ -120,6 +121,32 @@ "wip_limit": null } ], + "us_duedates": [ + { + "slug": "default", + "name": "Default", + "order": 1, + "by_default": true, + "color": "#999999", + "days_to_due": null + }, + { + "slug": "due-soon", + "name": "Due soon", + "order": 2, + "by_default": false, + "color": "#ff8a84", + "days_to_due": 14 + }, + { + "slug": "past-due", + "name": "Past due", + "order": 3, + "by_default": false, + "color": "#ff9900", + "days_to_due": 0 + } + ], "points": [ { "name": "?", @@ -219,6 +246,32 @@ "is_closed": false } ], + "task_duedates": [ + { + "slug": "default", + "name": "Default", + "order": 1, + "by_default": true, + "color": "#999999", + "days_to_due": null + }, + { + "slug": "due-soon", + "name": "Due soon", + "order": 2, + "by_default": false, + "color": "#ff8a84", + "days_to_due": 14 + }, + { + "slug": "past-due", + "name": "Past due", + "order": 3, + "by_default": false, + "color": "#ff9900", + "days_to_due": 0 + } + ], "issue_statuses": [ { "slug": "new", @@ -287,6 +340,32 @@ "order": 3 } ], + "issue_duedates": [ + { + "slug": "default", + "name": "Default", + "order": 1, + "by_default": true, + "color": "#999999", + "days_to_due": null + }, + { + "slug": "due-soon", + "name": "Due soon", + "order": 2, + "by_default": false, + "color": "#ff8a84", + "days_to_due": 14 + }, + { + "slug": "past-due", + "name": "Past due", + "order": 3, + "by_default": false, + "color": "#ff9900", + "days_to_due": 0 + } + ], "priorities": [ { "color": "#666666", @@ -692,6 +771,32 @@ "wip_limit": null } ], + "us_duedates": [ + { + "slug": "default", + "name": "Default", + "order": 1, + "by_default": true, + "color": "#999999", + "days_to_due": null + }, + { + "slug": "due-soon", + "name": "Due soon", + "order": 2, + "by_default": false, + "color": "#ff8a84", + "days_to_due": 14 + }, + { + "slug": "past-due", + "name": "Past due", + "order": 3, + "by_default": false, + "color": "#ff9900", + "days_to_due": 0 + } + ], "points": [ { "name": "?", @@ -791,6 +896,32 @@ "is_closed": false } ], + "task_duedates": [ + { + "slug": "default", + "name": "Default", + "order": 1, + "by_default": true, + "color": "#999999", + "days_to_due": null + }, + { + "slug": "due-soon", + "name": "Due soon", + "order": 2, + "by_default": false, + "color": "#ff8a84", + "days_to_due": 14 + }, + { + "slug": "past-due", + "name": "Past due", + "order": 3, + "by_default": false, + "color": "#ff9900", + "days_to_due": 0 + } + ], "issue_statuses": [ { "slug": "new", @@ -859,6 +990,32 @@ "order": 3 } ], + "issue_duedates": [ + { + "slug": "default", + "name": "Default", + "order": 1, + "by_default": true, + "color": "#999999", + "days_to_due": null + }, + { + "slug": "due-soon", + "name": "Due soon", + "order": 2, + "by_default": false, + "color": "#ff8a84", + "days_to_due": 14 + }, + { + "slug": "past-due", + "name": "Past due", + "order": 3, + "by_default": false, + "color": "#ff9900", + "days_to_due": 0 + } + ], "priorities": [ { "color": "#999999", diff --git a/taiga/projects/models.py b/taiga/projects/models.py index 1e8eb2f4..c57d8320 100644 --- a/taiga/projects/models.py +++ b/taiga/projects/models.py @@ -1250,13 +1250,9 @@ class ProjectTemplate(TaggedMixin, TagsColorsMixin, models.Model): if self.epic_statuses: project.default_epic_status = EpicStatus.objects.get(name=self.default_options["epic_status"], project=project) - if self.us_statuses: project.default_us_status = UserStoryStatus.objects.get(name=self.default_options["us_status"], project=project) - if self.us_duedates: - project.default_us_duedate = UserStoryDueDate.objects.get(name=self.default_options["us_duedates"], - project=project) if self.points: project.default_points = Points.objects.get(name=self.default_options["points"], project=project) @@ -1264,23 +1260,15 @@ class ProjectTemplate(TaggedMixin, TagsColorsMixin, models.Model): if self.task_statuses: project.default_task_status = TaskStatus.objects.get(name=self.default_options["task_status"], project=project) - if self.task_duedates: - project.default_task_duedate = TaskDueDate.objects.get(name=self.default_options["task_duedates"], - project=project) if self.issue_statuses: project.default_issue_status = IssueStatus.objects.get(name=self.default_options["issue_status"], project=project) - if self.issue_duedates: - project.default_issue_duedate = TaskDueDate.objects.get(name=self.default_options["issue_duedates"], - project=project) if self.issue_types: project.default_issue_type = IssueType.objects.get(name=self.default_options["issue_type"], project=project) - if self.priorities: project.default_priority = Priority.objects.get(name=self.default_options["priority"], project=project) - if self.severities: project.default_severity = Severity.objects.get(name=self.default_options["severity"], project=project)