fix: issue activity for attachments (#1626)

* fix: issue activity for attachments

* fix: issue activity assignees
This commit is contained in:
Nikhil 2023-07-24 12:17:41 +05:30 committed by GitHub
parent 479dfc17f5
commit 27402b52b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 2 deletions

View File

@ -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),
)
)

View File

@ -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)
]