diff --git a/apps/terminal/migrations/0067_remove_applet_enterprise_applet_edition.py b/apps/terminal/migrations/0067_remove_applet_enterprise_applet_edition.py new file mode 100644 index 000000000..3dd03408d --- /dev/null +++ b/apps/terminal/migrations/0067_remove_applet_enterprise_applet_edition.py @@ -0,0 +1,22 @@ +# Generated by Django 4.1.10 on 2023-08-10 06:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('terminal', '0066_auto_20230810_1118'), + ] + + operations = [ + migrations.RemoveField( + model_name='applet', + name='enterprise', + ), + migrations.AddField( + model_name='applet', + name='edition', + field=models.CharField(choices=[('community', 'Community'), ('enterprise', 'Enterprise')], default='community', max_length=128, verbose_name='Edition'), + ), + ] diff --git a/apps/terminal/models/applet/applet.py b/apps/terminal/models/applet/applet.py index 547b89065..ccd1a8e52 100644 --- a/apps/terminal/models/applet/applet.py +++ b/apps/terminal/models/applet/applet.py @@ -33,7 +33,8 @@ class Applet(JMSBaseModel): display_name = models.CharField(max_length=128, verbose_name=_('Display name')) version = models.CharField(max_length=16, verbose_name=_('Version')) author = models.CharField(max_length=128, verbose_name=_('Author')) - enterprise = models.BooleanField(default=False, verbose_name=_('Enterprise')) + edition = models.CharField(max_length=128, choices=Edition.choices, default=Edition.community, + verbose_name=_('Edition')) type = models.CharField(max_length=16, verbose_name=_('Type'), default='general', choices=Type.choices) is_active = models.BooleanField(default=True, verbose_name=_('Is active')) builtin = models.BooleanField(default=False, verbose_name=_('Builtin')) diff --git a/apps/terminal/serializers/applet.py b/apps/terminal/serializers/applet.py index 681ff232b..0b1737232 100644 --- a/apps/terminal/serializers/applet.py +++ b/apps/terminal/serializers/applet.py @@ -35,6 +35,6 @@ class AppletSerializer(serializers.ModelSerializer): 'icon', 'readme', 'date_created', 'date_updated', ] fields = fields_mini + [ - 'version', 'author', 'type', 'enterprise', + 'version', 'author', 'type', 'edition', 'can_concurrent', 'protocols', 'tags', 'comment', ] + read_only_fields