Skip to content

Commit

Permalink
Merge pull request #5910 from uktrade/bugfix/TET-832-wrong-data-type
Browse files Browse the repository at this point in the history
Make modified_by and created_by fields CharField instead of Integer to match prod Stova data
  • Loading branch information
DeanElliott96 authored Jan 21, 2025
2 parents 6904afb + d86de35 commit 037c71e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.17 on 2025-01-21 10:58

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('company_activity', '0023_link_stova_attendee_to_event'),
]

operations = [
migrations.AlterField(
model_name='stovaevent',
name='created_by',
field=models.CharField(blank=True, default='', max_length=255),
),
migrations.AlterField(
model_name='stovaevent',
name='modified_by',
field=models.CharField(blank=True, default='', max_length=255),
),
]
4 changes: 2 additions & 2 deletions datahub/company_activity/models/stova_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class StovaEvent(models.Model):
description = models.TextField()
code = models.CharField(max_length=MAX_LENGTH)

created_by = models.IntegerField(null=True, blank=True)
modified_by = models.IntegerField(null=True, blank=True)
created_by = models.CharField(max_length=MAX_LENGTH, blank=True, default='')
modified_by = models.CharField(max_length=MAX_LENGTH, blank=True, default='')

client_contact = models.IntegerField(null=True, blank=True)
contact_info = models.CharField(max_length=MAX_LENGTH)
Expand Down
4 changes: 2 additions & 2 deletions datahub/company_activity/tasks/ingest_stova_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ def _process_record(self, record: dict) -> None:
'folder_id': record.get('folder_id'),
'live_date': record.get('live_date'),
'close_date': record.get('close_date'),
'created_by': record.get('created_by'),
'created_by': record.get('created_by', ''),
'price_type': record.get('price_type', ''),
'start_date': record.get('start_date'),
'description': record.get('description', ''),
'modified_by': record.get('modified_by'),
'modified_by': record.get('modified_by', ''),
'contact_info': record.get('contact_info', ''),
'created_date': record.get('created_date'),
'location_city': record.get('location_city', ''),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def test_base_stova_event():
'folder_id': 3479,
'live_date': '2024-10-08 10:48:36.204549+00:00',
'close_date': '2024-10-08 10:48:36.204570+00:00',
'created_by': 5808,
'created_by': '[email protected]',
'price_type': 'net',
'start_date': '2024-10-08 10:48:36.204592+00:00',
'description': 'star',
'modified_by': 9588,
'modified_by': '[email protected]',
'contact_info': '[email protected]',
'created_date': '2024-10-08 10:48:36.204839+00:00',
'location_city': 'Port Laurenside',
Expand Down

0 comments on commit 037c71e

Please sign in to comment.