From 787af3d4ac7f4bac925fbbe129b9a9f7f7b684b8 Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Mon, 11 Mar 2024 20:38:41 +0530 Subject: [PATCH] dev: add anonymous telemetry field in instance --- .../plane/license/api/serializers/instance.py | 6 +----- .../0002_instance_is_telemetry_anonymous.py | 18 ++++++++++++++++++ apiserver/plane/license/models/instance.py | 3 ++- 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 apiserver/plane/license/migrations/0002_instance_is_telemetry_anonymous.py diff --git a/apiserver/plane/license/api/serializers/instance.py b/apiserver/plane/license/api/serializers/instance.py index 8a99acbae..b59c15941 100644 --- a/apiserver/plane/license/api/serializers/instance.py +++ b/apiserver/plane/license/api/serializers/instance.py @@ -1,14 +1,10 @@ # Module imports +from plane.app.serializers import BaseSerializer, UserAdminLiteSerializer from plane.license.models import Instance, InstanceAdmin, InstanceConfiguration -from plane.app.serializers import BaseSerializer -from plane.app.serializers import UserAdminLiteSerializer from plane.license.utils.encryption import decrypt_data class InstanceSerializer(BaseSerializer): - primary_owner_details = UserAdminLiteSerializer( - source="primary_owner", read_only=True - ) class Meta: model = Instance diff --git a/apiserver/plane/license/migrations/0002_instance_is_telemetry_anonymous.py b/apiserver/plane/license/migrations/0002_instance_is_telemetry_anonymous.py new file mode 100644 index 000000000..a1a566458 --- /dev/null +++ b/apiserver/plane/license/migrations/0002_instance_is_telemetry_anonymous.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.10 on 2024-03-11 15:03 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('license', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='instance', + name='is_telemetry_anonymous', + field=models.BooleanField(default=False), + ), + ] diff --git a/apiserver/plane/license/models/instance.py b/apiserver/plane/license/models/instance.py index b8957e44f..cad77ea1a 100644 --- a/apiserver/plane/license/models/instance.py +++ b/apiserver/plane/license/models/instance.py @@ -1,6 +1,6 @@ # Django imports -from django.db import models from django.conf import settings +from django.db import models # Module imports from plane.db.models import BaseModel @@ -21,6 +21,7 @@ class Instance(BaseModel): namespace = models.CharField(max_length=50, blank=True, null=True) # telemetry and support is_telemetry_enabled = models.BooleanField(default=True) + is_telemetry_anonymous = models.BooleanField(default=False) is_support_required = models.BooleanField(default=True) # is setup done is_setup_done = models.BooleanField(default=False)