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:
parent
386c01d89e
commit
cc54a136f1
@ -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)
|
||||||
|
|
||||||
collection_type_obj, _ = models.CollectionType.objects.get_or_create(uid=data.collectionType, owner=user)
|
try:
|
||||||
|
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,
|
||||||
|
Loading…
Reference in New Issue
Block a user