From 8ac7b91ba886a2af7d40fe43c6ee25c4ac7d6763 Mon Sep 17 00:00:00 2001 From: jedi Date: Tue, 18 Jun 2024 16:55:34 +0200 Subject: [PATCH] stash --- core/tickets/migrations/0012_shippingvoucher.py | 4 ++-- core/tickets/models.py | 2 +- core/tickets/serializers.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/tickets/migrations/0012_shippingvoucher.py b/core/tickets/migrations/0012_shippingvoucher.py index f00c4cd..0c40df1 100644 --- a/core/tickets/migrations/0012_shippingvoucher.py +++ b/core/tickets/migrations/0012_shippingvoucher.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.7 on 2024-06-18 14:42 +# Generated by Django 4.2.7 on 2024-06-18 14:54 from django.db import migrations, models import django.db.models.deletion @@ -15,7 +15,7 @@ class Migration(migrations.Migration): name='ShippingVoucher', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), - ('code', models.CharField(max_length=255)), + ('voucher', models.CharField(max_length=255)), ('type', models.CharField(max_length=255)), ('timestamp', models.DateTimeField(auto_now_add=True)), ('used_at', models.DateTimeField(null=True)), diff --git a/core/tickets/models.py b/core/tickets/models.py index a1e6c91..81176a9 100644 --- a/core/tickets/models.py +++ b/core/tickets/models.py @@ -141,7 +141,7 @@ class ItemRelation(models.Model): class ShippingVoucher(models.Model): id = models.AutoField(primary_key=True) issue_thread = models.ForeignKey(IssueThread, on_delete=models.CASCADE, related_name='shipping_vouchers', null=True) - code = models.CharField(max_length=255) + voucher = models.CharField(max_length=255) type = models.CharField(max_length=255) timestamp = models.DateTimeField(auto_now_add=True) used_at = models.DateTimeField(null=True) diff --git a/core/tickets/serializers.py b/core/tickets/serializers.py index acd8afc..c2e07e2 100644 --- a/core/tickets/serializers.py +++ b/core/tickets/serializers.py @@ -127,8 +127,8 @@ class IssueSerializer(serializers.ModelSerializer): 'type': 'shipping_voucher', 'id': shipping_voucher.id, 'timestamp': shipping_voucher.used_at, - 'code': shipping_voucher.code, - 'code_type': shipping_voucher.type, + 'voucher': shipping_voucher.voucher, + 'voucher_type': shipping_voucher.type, }) return sorted(timeline, key=lambda x: x['timestamp'])