diff --git a/apiserver/plane/bgtasks/issue_activites_task.py b/apiserver/plane/bgtasks/issue_activites_task.py index 49b1a4145..c2502cd68 100644 --- a/apiserver/plane/bgtasks/issue_activites_task.py +++ b/apiserver/plane/bgtasks/issue_activites_task.py @@ -376,7 +376,7 @@ def track_assignees( verb="updated", old_value=assignee.email, new_value="", - field="assignee", + field="assignees", project=project, workspace=project.workspace, comment=f"{actor.email} removed assignee {assignee.email}", @@ -989,7 +989,7 @@ def create_attachment_activity( verb="created", actor=actor, field="attachment", - new_value=current_instance.get("access", ""), + new_value=current_instance.get("asset", ""), new_identifier=current_instance.get("id", None), ) ) diff --git a/apiserver/plane/db/migrations/0039_auto_20230723_2203.py b/apiserver/plane/db/migrations/0039_auto_20230723_2203.py new file mode 100644 index 000000000..e6dc81306 --- /dev/null +++ b/apiserver/plane/db/migrations/0039_auto_20230723_2203.py @@ -0,0 +1,26 @@ +# Generated by Django 4.2.3 on 2023-07-23 16:33 + +from django.db import migrations + +def rename_field(apps, schema_editor): + Model = apps.get_model("db", "IssueActivity") + updated_activity = [] + for obj in Model.objects.filter(field="assignee"): + obj.field = "assignees" + updated_activity.append(obj) + + Model.objects.bulk_update( + updated_activity, ["field"], batch_size=100 + ) + + + +class Migration(migrations.Migration): + + dependencies = [ + ('db', '0038_auto_20230720_1505'), + ] + + operations = [ + migrations.RunPython(rename_field) + ]