events: set default transport mode

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-05-30 21:32:48 +02:00
parent 59e13e8026
commit a0397fdcf4
2 changed files with 3 additions and 2 deletions

View file

@ -42,7 +42,8 @@ class Migration(migrations.Migration):
("webhook", "Generic Webhook"), ("webhook", "Generic Webhook"),
("webhook_slack", "Slack Webhook (Slack/Discord)"), ("webhook_slack", "Slack Webhook (Slack/Discord)"),
("email", "Email"), ("email", "Email"),
] ],
default="local",
), ),
), ),
migrations.RunPython(notify_local_transport), migrations.RunPython(notify_local_transport),

View file

@ -301,7 +301,7 @@ class NotificationTransport(models.Model):
uuid = models.UUIDField(primary_key=True, editable=False, default=uuid4) uuid = models.UUIDField(primary_key=True, editable=False, default=uuid4)
name = models.TextField(unique=True) name = models.TextField(unique=True)
mode = models.TextField(choices=TransportMode.choices) mode = models.TextField(choices=TransportMode.choices, default=TransportMode.LOCAL)
webhook_url = models.TextField(blank=True, validators=[DomainlessURLValidator()]) webhook_url = models.TextField(blank=True, validators=[DomainlessURLValidator()])
webhook_mapping = models.ForeignKey( webhook_mapping = models.ForeignKey(