fix: handle missing comments in create_comment_reaction_activity and format cycle dates in IssueExportSchema

This commit is contained in:
pablohashescobar
2025-10-22 16:03:24 +05:30
parent 98b81d7ebb
commit b45d6d695d
2 changed files with 11 additions and 3 deletions
@@ -1154,7 +1154,10 @@ def create_comment_reaction_activity(
.values_list("id", "comment__id")
.first()
)
comment = IssueComment.objects.get(pk=comment_id, project_id=project_id)
comment = IssueComment.objects.filter(pk=comment_id, project_id=project_id).first()
if comment is None:
return
if comment is not None and comment_reaction_id is not None and comment_id is not None:
issue_activities.append(
IssueActivity(
@@ -169,12 +169,17 @@ class IssueExportSchema(ExportSchema):
def prepare_cycle_start_date(self, i):
cycles_dict = self.context.get("cycles_dict") or {}
last_cycle = cycles_dict.get(i.id)
return last_cycle.cycle.start_date if last_cycle else None
if last_cycle and last_cycle.cycle.start_date:
return self._format_date(last_cycle.cycle.start_date)
return ""
def prepare_cycle_end_date(self, i):
cycles_dict = self.context.get("cycles_dict") or {}
last_cycle = cycles_dict.get(i.id)
return last_cycle.cycle.end_date if last_cycle else None
if last_cycle and last_cycle.cycle.end_date:
return self._format_date(last_cycle.cycle.end_date)
return ""
def prepare_parent(self, i):
if not i.parent: