diff --git a/djangoldp/serializers.py b/djangoldp/serializers.py index f565863fdfecfc585cd0467680a1a80a727107db..c17e021bf6b7a2abdb1c084bd1449efc244fd42b 100644 --- a/djangoldp/serializers.py +++ b/djangoldp/serializers.py @@ -651,11 +651,11 @@ class LDPSerializer(HyperlinkedModelSerializer): kwargs = {slug_field: field_dict[slug_field]} sub_inst = field_model.objects.get(**kwargs) if sub_inst is None: - with transaction.atomic(): - try: - sub_inst = self.internal_create(field_dict, field_model) - except: - continue + if create: + sub_inst = self.internal_create(field_dict, field_model) + else: + continue + validated_data[field_name] = sub_inst return validated_data