Skip to content

Commit 5da71bb

Browse files
committed
move event field to the abstract models
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent d13a6a9 commit 5da71bb

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

aboutcode/notifications/models.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ class AbstractWebhookSubscription(models.Model):
4646
default=True,
4747
help_text=_("Indicates whether the Webhook is currently active and should be triggered."),
4848
)
49+
event = models.CharField(
50+
_("Event"),
51+
max_length=64,
52+
null=True,
53+
blank=True,
54+
help_text=_("The event type that triggers this Webhook subscription."),
55+
)
4956
created_date = models.DateTimeField(
5057
auto_now_add=True,
5158
editable=False,

notification/migrations/0002_webhooksubscription_webhookdelivery.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ class Migration(migrations.Migration):
4848
(
4949
"event",
5050
models.CharField(
51+
blank=True,
5152
help_text="The event type that triggers this Webhook subscription.",
5253
max_length=64,
54+
null=True,
5355
verbose_name="Event",
5456
),
5557
),

notification/models.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ class WebhookSubscription(DataspacedModel, AbstractWebhookSubscription):
3434
target URL and the specific events that trigger the Webhook.
3535
"""
3636

37-
event = models.CharField(
38-
_("Event"),
39-
max_length=64,
40-
help_text=_("The event type that triggers this Webhook subscription."),
41-
)
4237
extra_payload = models.JSONField(
4338
blank=True,
4439
default=dict,

0 commit comments

Comments
 (0)