From 1d013685708dd1749d43363b9dfb7440b884d617 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Fri, 10 Feb 2023 21:13:12 +0000 Subject: [PATCH] Add webhook ID to asset restriction model --- ...ion_webhook_id_alter_assetgroup_allowed.py | 24 +++++++++++++++++++ core/models.py | 3 +++ 2 files changed, 27 insertions(+) create mode 100644 core/migrations/0054_assetrestriction_webhook_id_alter_assetgroup_allowed.py diff --git a/core/migrations/0054_assetrestriction_webhook_id_alter_assetgroup_allowed.py b/core/migrations/0054_assetrestriction_webhook_id_alter_assetgroup_allowed.py new file mode 100644 index 0000000..0d5a824 --- /dev/null +++ b/core/migrations/0054_assetrestriction_webhook_id_alter_assetgroup_allowed.py @@ -0,0 +1,24 @@ +# Generated by Django 4.1.6 on 2023-02-10 21:07 + +from django.db import migrations, models +import uuid + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0053_assetrestriction_pairs_parsed_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='assetrestriction', + name='webhook_id', + field=models.UUIDField(default=uuid.uuid4, editable=False, unique=True), + ), + migrations.AlterField( + model_name='assetgroup', + name='allowed', + field=models.JSONField(blank=True, default=dict, null=True), + ), + ] diff --git a/core/models.py b/core/models.py index 3434fc3..b95af3c 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,4 @@ +import uuid from datetime import timedelta import stripe @@ -439,6 +440,8 @@ class AssetRestriction(models.Model): pairs = models.CharField(max_length=4096, null=True, blank=True) pairs_parsed = models.JSONField(null=True, blank=True) + webhook_id = models.UUIDField(default=uuid.uuid4, editable=False, unique=True) + group = models.ForeignKey( AssetGroup, on_delete=models.CASCADE, null=True, blank=True )