mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: validation for issue activity description (#1887)
This commit is contained in:
parent
10dface85d
commit
b24622e5ef
@ -184,19 +184,24 @@ def track_description(
|
|||||||
if current_instance.get("description_html") != requested_data.get(
|
if current_instance.get("description_html") != requested_data.get(
|
||||||
"description_html"
|
"description_html"
|
||||||
):
|
):
|
||||||
issue_activities.append(
|
last_activity = IssueActivity.objects.filter(issue_id=issue_id).order_by("-created_at").first()
|
||||||
IssueActivity(
|
if(last_activity is not None and last_activity.field == "description" and actor.id == last_activity.actor_id):
|
||||||
issue_id=issue_id,
|
last_activity.created_at = timezone.now()
|
||||||
actor=actor,
|
last_activity.save(update_fields=["created_at"])
|
||||||
verb="updated",
|
else:
|
||||||
old_value=current_instance.get("description_html"),
|
issue_activities.append(
|
||||||
new_value=requested_data.get("description_html"),
|
IssueActivity(
|
||||||
field="description",
|
issue_id=issue_id,
|
||||||
project=project,
|
actor=actor,
|
||||||
workspace=project.workspace,
|
verb="updated",
|
||||||
comment=f"updated the description to {requested_data.get('description_html')}",
|
old_value=current_instance.get("description_html"),
|
||||||
)
|
new_value=requested_data.get("description_html"),
|
||||||
)
|
field="description",
|
||||||
|
project=project,
|
||||||
|
workspace=project.workspace,
|
||||||
|
comment=f"updated the description to {requested_data.get('description_html')}",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Track changes in issue target date
|
# Track changes in issue target date
|
||||||
|
Loading…
Reference in New Issue
Block a user