1
0
mirror of https://github.com/etesync/server synced 2024-11-22 00:38:07 +00:00

Fix server error when passing null collection types.

This commit is contained in:
Tom Hacohen 2024-06-29 14:55:48 -04:00
parent 386c01d89e
commit cc54a136f1

View File

@ -342,7 +342,10 @@ def _create(data: CollectionIn, user: UserType):
# TODO # TODO
process_revisions_for_item(main_item, data.item.content) process_revisions_for_item(main_item, data.item.content)
try:
collection_type_obj, _ = models.CollectionType.objects.get_or_create(uid=data.collectionType, owner=user) collection_type_obj, _ = models.CollectionType.objects.get_or_create(uid=data.collectionType, owner=user)
except IntegrityError:
raise ValidationError("bad_collection_type", "collectionType is null")
models.CollectionMember( models.CollectionMember(
collection=instance, collection=instance,