Skip to content

Commit

Permalink
[#2433] Add "Cancelled" scheduled email status
Browse files Browse the repository at this point in the history
  • Loading branch information
pbanaszkiewicz committed Jun 28, 2023
1 parent f3f1734 commit a07f049
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions amy/emails/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Migration(migrations.Migration):
('created_at', models.DateTimeField(auto_now_add=True)),
('last_updated_at', models.DateTimeField(auto_now=True, null=True)),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('state', models.CharField(choices=[('scheduled', 'Scheduled'), ('locked', 'Locked'), ('running', 'Running'), ('succeeded', 'Succeeded'), ('failed', 'Failed')], default='scheduled', max_length=30)),
('state', models.CharField(choices=[('scheduled', 'Scheduled'), ('locked', 'Locked'), ('running', 'Running'), ('succeeded', 'Succeeded'), ('failed', 'Failed'), ('cancelled', 'Cancelled')], default='scheduled', max_length=30)),
('scheduled_at', models.DateTimeField(editable=False, verbose_name='Timestamp of scheduled run')),
('to_header', django.contrib.postgres.fields.ArrayField(base_field=models.EmailField(max_length=254), size=None, verbose_name='To (header)')),
('from_header', models.EmailField(max_length=254, verbose_name='From (header)')),
Expand All @@ -59,8 +59,8 @@ class Migration(migrations.Migration):
('created_at', models.DateTimeField(auto_now_add=True)),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('details', models.CharField(editable=False, max_length=255)),
('state_before', models.CharField(blank=True, choices=[('scheduled', 'Scheduled'), ('locked', 'Locked'), ('running', 'Running'), ('succeeded', 'Succeeded'), ('failed', 'Failed')], editable=False, max_length=30, null=True)),
('state_after', models.CharField(choices=[('scheduled', 'Scheduled'), ('locked', 'Locked'), ('running', 'Running'), ('succeeded', 'Succeeded'), ('failed', 'Failed')], editable=False, max_length=30)),
('state_before', models.CharField(blank=True, choices=[('scheduled', 'Scheduled'), ('locked', 'Locked'), ('running', 'Running'), ('succeeded', 'Succeeded'), ('failed', 'Failed'), ('cancelled', 'Cancelled')], editable=False, max_length=30, null=True)),
('state_after', models.CharField(choices=[('scheduled', 'Scheduled'), ('locked', 'Locked'), ('running', 'Running'), ('succeeded', 'Succeeded'), ('failed', 'Failed'), ('cancelled', 'Cancelled')], editable=False, max_length=30)),
('scheduled_email', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='emails.scheduledemail')),
],
options={
Expand Down
1 change: 1 addition & 0 deletions amy/emails/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class ScheduledEmailStatus(models.TextChoices):
RUNNING = "running"
SUCCEEDED = "succeeded"
FAILED = "failed"
CANCELLED = "cancelled"


class ScheduledEmail(CreatedUpdatedMixin, models.Model):
Expand Down

0 comments on commit a07f049

Please sign in to comment.