diff --git a/taiga/export_import/serializers.py b/taiga/export_import/serializers.py index e3996e59..0af1ae52 100644 --- a/taiga/export_import/serializers.py +++ b/taiga/export_import/serializers.py @@ -363,6 +363,9 @@ class BaseCustomAttributesValuesExportSerializer(serializers.ModelSerializer): _custom_attribute_model = None _container_field = None + class Meta: + exclude = ("id",) + def validate_attributes_values(self, attrs, source): # values must be a dict data_values = attrs.get("attributes_values", None) @@ -394,27 +397,24 @@ class UserStoryCustomAttributesValuesExportSerializer(BaseCustomAttributesValues _container_model = "userstories.UserStory" _container_field = "user_story" - class Meta: + class Meta(BaseCustomAttributesValuesExportSerializer.Meta): model = custom_attributes_models.UserStoryCustomAttributesValues - exclude = ("id",) class TaskCustomAttributesValuesExportSerializer(BaseCustomAttributesValuesExportSerializer): _custom_attribute_model = custom_attributes_models.TaskCustomAttribute _container_field = "task" - class Meta: + class Meta(BaseCustomAttributesValuesExportSerializer.Meta): model = custom_attributes_models.TaskCustomAttributesValues - exclude = ("id",) class IssueCustomAttributesValuesExportSerializer(BaseCustomAttributesValuesExportSerializer): _custom_attribute_model = custom_attributes_models.IssueCustomAttribute _container_field = "issue" - class Meta: + class Meta(BaseCustomAttributesValuesExportSerializer.Meta): model = custom_attributes_models.IssueCustomAttributesValues - exclude = ("id",) class MembershipExportSerializer(serializers.ModelSerializer): diff --git a/taiga/projects/custom_attributes/serializers.py b/taiga/projects/custom_attributes/serializers.py index 06f46ec2..0a7d4a65 100644 --- a/taiga/projects/custom_attributes/serializers.py +++ b/taiga/projects/custom_attributes/serializers.py @@ -80,6 +80,9 @@ class BaseCustomAttributesValuesSerializer(ModelSerializer): _custom_attribute_model = None _container_field = None + class Meta: + exclude = ("id",) + def validate_attributes_values(self, attrs, source): # values must be a dict data_values = attrs.get("attributes_values", None) @@ -112,7 +115,7 @@ class UserStoryCustomAttributesValuesSerializer(BaseCustomAttributesValuesSerial _container_model = "userstories.UserStory" _container_field = "user_story" - class Meta: + class Meta(BaseCustomAttributesValuesSerializer.Meta): model = models.UserStoryCustomAttributesValues @@ -120,7 +123,7 @@ class TaskCustomAttributesValuesSerializer(BaseCustomAttributesValuesSerializer, _custom_attribute_model = models.TaskCustomAttribute _container_field = "task" - class Meta: + class Meta(BaseCustomAttributesValuesSerializer.Meta): model = models.TaskCustomAttributesValues @@ -128,5 +131,5 @@ class IssueCustomAttributesValuesSerializer(BaseCustomAttributesValuesSerializer _custom_attribute_model = models.IssueCustomAttribute _container_field = "issue" - class Meta: + class Meta(BaseCustomAttributesValuesSerializer.Meta): model = models.IssueCustomAttributesValues