From 6524764ca7104ce25a7c7abe2c4a732624dc0cdb Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Fri, 5 Jul 2024 13:40:51 +0000 Subject: [PATCH] Add Msg.is_android field --- temba/msgs/migrations/0266_msg_is_android.py | 10 ++++++++++ temba/msgs/models.py | 1 + temba/tests/base.py | 1 + 3 files changed, 12 insertions(+) create mode 100644 temba/msgs/migrations/0266_msg_is_android.py diff --git a/temba/msgs/migrations/0266_msg_is_android.py b/temba/msgs/migrations/0266_msg_is_android.py new file mode 100644 index 00000000000..c082e78bf57 --- /dev/null +++ b/temba/msgs/migrations/0266_msg_is_android.py @@ -0,0 +1,10 @@ +# Generated by Django 5.0.6 on 2024-07-05 13:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [("msgs", "0265_broadcast_template_variables")] + + operations = [migrations.AddField(model_name="msg", name="is_android", field=models.BooleanField(null=True))] diff --git a/temba/msgs/models.py b/temba/msgs/models.py index 619de62732f..3db793bc839 100644 --- a/temba/msgs/models.py +++ b/temba/msgs/models.py @@ -526,6 +526,7 @@ class Msg(models.Model): direction = models.CharField(max_length=1, choices=DIRECTION_CHOICES) status = models.CharField(max_length=1, choices=STATUS_CHOICES, default=STATUS_PENDING, db_index=True) visibility = models.CharField(max_length=1, choices=VISIBILITY_CHOICES, default=VISIBILITY_VISIBLE) + is_android = models.BooleanField(null=True) labels = models.ManyToManyField("Label", related_name="msgs") # the number of actual messages the channel sent this as (outgoing only) diff --git a/temba/tests/base.py b/temba/tests/base.py index 35508648c4b..ceed58d6346 100644 --- a/temba/tests/base.py +++ b/temba/tests/base.py @@ -442,6 +442,7 @@ def _create_msg( status=status or (Msg.STATUS_PENDING if direction == Msg.DIRECTION_IN else Msg.STATUS_INITIALIZING), msg_type=msg_type, visibility=visibility, + is_android=channel and channel.is_android, external_id=external_id, high_priority=high_priority, created_on=created_on or timezone.now(),