diff --git a/epictrack-api/setup.cfg b/epictrack-api/setup.cfg index ba8b4fc3..3cc38151 100644 --- a/epictrack-api/setup.cfg +++ b/epictrack-api/setup.cfg @@ -71,7 +71,7 @@ notes=FIXME,XXX,TODO ignored-modules=flask_sqlalchemy,sqlalchemy,SQLAlchemy,alembic,scoped_session ignored-classes=scoped_session min-similarity-lines=15 -disable=C0301,W0511, R0917, C0411, R1710, E1101, W4904, R0914, R1702 +disable=C0301,W0511, R0917, C0411, R1710, E1101, W4904, R0914, R1702, R0912 good-names=f,id,k,v [isort] diff --git a/epictrack-api/src/api/reports/anticipated_schedule_report.py b/epictrack-api/src/api/reports/anticipated_schedule_report.py index 63f75639..106f8a57 100644 --- a/epictrack-api/src/api/reports/anticipated_schedule_report.py +++ b/epictrack-api/src/api/reports/anticipated_schedule_report.py @@ -66,7 +66,8 @@ def __init__(self, filters, color_intensity): "next_pecp_short_description", "milestone_type", "category_type", - "event_name" + "event_name", + "notes" ] group_by = "phase_name" template_name = "anticipated_schedule.docx" @@ -272,6 +273,7 @@ def generate_report(self, report_date, return_type): item_dict = item._asdict() item_dict['work_issues'] = work_issues works_list.append(item_dict) + item_dict['notes'] = "" # go through all the work issues, find the update and add the description to the issue for issue in work_issues: @@ -289,6 +291,9 @@ def generate_report(self, report_date, return_type): for work_issue in item_dict['work_issues']: if work_issue.id == issue.id: work_issue.description = work_issue_updates.description + current_app.logger.debug(f"----Work title: {work_issue.title}") + current_app.logger.debug(f"----Work description: {work_issue.description}") + item_dict['notes'] += f"{work_issue.title}: {work_issue.description} " data = self._format_data(works_list, self.report_title) data = self._update_staleness(data, report_date) diff --git a/epictrack-api/src/api/reports/report_factory.py b/epictrack-api/src/api/reports/report_factory.py index eb78360f..c8cb426d 100644 --- a/epictrack-api/src/api/reports/report_factory.py +++ b/epictrack-api/src/api/reports/report_factory.py @@ -36,10 +36,13 @@ def _format_data(self, data, report_title=None): excluded_items = self.filters["exclude"] if report_title == "Anticipated EA Referral Schedule": for item in data: - obj = { - k: (item[k] if k != "work_issues" else self._deserialize_work_issues(item[k])) - for k in self.data_keys if k not in excluded_items - } + obj = {} + for k in self.data_keys: + if k not in excluded_items: + if k == "work_issues": + obj[k] = self._deserialize_work_issues(item[k]) + else: + obj[k] = item[k] if self.group_by: obj["sl_no"] = len(formatted_data[obj.get(self.group_by)]) + 1 formatted_data[obj.get(self.group_by)].append(obj) diff --git a/epictrack-api/src/api/reports/report_templates/anticipated_schedule.docx b/epictrack-api/src/api/reports/report_templates/anticipated_schedule.docx index 91f7486b..bf223431 100644 Binary files a/epictrack-api/src/api/reports/report_templates/anticipated_schedule.docx and b/epictrack-api/src/api/reports/report_templates/anticipated_schedule.docx differ