fix: validation for issue activity description

This commit is contained in:
NarayanBavisetti 2023-08-16 17:05:47 +05:30
parent 550473bb02
commit 8711847760

View File

@ -184,6 +184,11 @@ def track_description(
if current_instance.get("description_html") != requested_data.get(
"description_html"
):
last_activity = IssueActivity.objects.filter(issue_id=issue_id).order_by("-created_at").first()
if(last_activity is not None and last_activity.field == "description" and actor.id == last_activity.actor_id):
last_activity.created_at = timezone.now()
last_activity.save(update_fields=["created_at"])
else:
issue_activities.append(
IssueActivity(
issue_id=issue_id,