Skip to content

Commit

Permalink
Add Msg.is_android field
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Jul 5, 2024
1 parent efbf2ef commit 6524764
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions temba/msgs/migrations/0266_msg_is_android.py
Original file line number Diff line number Diff line change
@@ -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))]
1 change: 1 addition & 0 deletions temba/msgs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions temba/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 6524764

Please sign in to comment.