From d944b5f4ff5c94f2c0f8d87dca9ae9fc047cd2fa Mon Sep 17 00:00:00 2001 From: Bai Date: Mon, 7 Sep 2020 19:36:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(tickets):=20=E5=B7=A5=E5=8D=95=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0comment=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tickets/migrations/0004_ticket_comment.py | 18 ++++++++++++++++++ apps/tickets/models/ticket.py | 1 + apps/tickets/serializers/request_asset_perm.py | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 apps/tickets/migrations/0004_ticket_comment.py diff --git a/apps/tickets/migrations/0004_ticket_comment.py b/apps/tickets/migrations/0004_ticket_comment.py new file mode 100644 index 000000000..c30776eb9 --- /dev/null +++ b/apps/tickets/migrations/0004_ticket_comment.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.13 on 2020-09-07 11:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('tickets', '0003_auto_20200804_1551'), + ] + + operations = [ + migrations.AddField( + model_name='ticket', + name='comment', + field=models.TextField(blank=True, default='', max_length=128, verbose_name='Comment'), + ), + ] diff --git a/apps/tickets/models/ticket.py b/apps/tickets/models/ticket.py index 3e979f244..f52172fb3 100644 --- a/apps/tickets/models/ticket.py +++ b/apps/tickets/models/ticket.py @@ -40,6 +40,7 @@ class Ticket(OrgModelMixin, CommonModelMixin): type = models.CharField(max_length=16, choices=TYPE.choices, default=TYPE.GENERAL, verbose_name=_("Type")) status = models.CharField(choices=STATUS.choices, max_length=16, default='open') action = models.CharField(choices=ACTION.choices, max_length=16, default='', blank=True) + comment = models.TextField(max_length=128, default='', blank=True, verbose_name=_('Comment')) origin_objects = models.Manager() diff --git a/apps/tickets/serializers/request_asset_perm.py b/apps/tickets/serializers/request_asset_perm.py index 8827f482c..5c7e08cfd 100644 --- a/apps/tickets/serializers/request_asset_perm.py +++ b/apps/tickets/serializers/request_asset_perm.py @@ -46,7 +46,7 @@ class RequestAssetPermTicketSerializer(serializers.ModelSerializer): 'status', 'action', 'date_created', 'date_updated', 'system_user_waitlist_url', 'type', 'type_display', 'action_display', 'ips', 'confirmed_assets', 'date_start', 'date_expired', 'confirmed_system_user', 'hostname', - 'assets_waitlist_url', 'system_user', 'org_id', 'actions' + 'assets_waitlist_url', 'system_user', 'org_id', 'actions', 'comment' ] m2m_fields = [ 'user', 'user_display', 'assignees', 'assignees_display',