diff options
-rw-r--r-- | archaeological_operations/models.py | 2 | ||||
-rw-r--r-- | ishtar_common/serializers.py | 2 | ||||
-rw-r--r-- | ishtar_common/tests.py | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index d826d3c79..b547db375 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -108,7 +108,7 @@ class RecordQualityType(GeneralType): class CulturalAttributionType(HierarchicalType): - order = models.IntegerField(_("Order")) + order = models.IntegerField(_("Order"), default=10) class Meta: verbose_name = _("Cultural attribution type") 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): |