mirror of
https://github.com/makeplane/plane.git
synced 2026-05-12 11:58:41 -05:00
fix: handle missing comments in create_comment_reaction_activity and format cycle dates in IssueExportSchema
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user