From bf40ecc3a19345ad56beca7082b695b789a252a7 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 24 Sep 2019 10:42:46 +0200 Subject: Remove (for now) ContentType from serialization --- ishtar_common/serializers.py | 2 +- ishtar_common/tests.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/serializers.py b/ishtar_common/serializers.py index 29d6c76bf..84108c135 100644 --- a/ishtar_common/serializers.py +++ b/ishtar_common/serializers.py @@ -40,7 +40,7 @@ TYPE_MODEL_EXCLUDE = ["Area", "OperationTypeOld", "ProfileTypeSummary"] def get_type_models(): - return [ContentType, Permission, Group] + [ + return [Permission, Group] + [ model for model in apps.get_models() if isinstance(model(), models.GeneralType) and ( model.__name__ not in TYPE_MODEL_EXCLUDE) diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 4596f9b5e..9b7080387 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -714,10 +714,11 @@ class SerializationTest(GenericSerializationTest, TestCase): from archaeological_finds.models import MaterialTypeQualityType, \ ObjectTypeQualityType, AlterationType, AlterationCauseType, \ TreatmentEmergencyType, CommunicabilityType + from archaeological_operations.models import CulturalAttributionType for model in (models.LicenseType, MaterialTypeQualityType, ObjectTypeQualityType, AlterationType, AlterationCauseType, TreatmentEmergencyType, - CommunicabilityType): + CommunicabilityType, CulturalAttributionType): model.objects.create(txt_idx="test", label="Test") def test_type_serialization(self): -- cgit v1.2.3