mirror of
https://github.com/etesync/server
synced 2024-11-21 16:28:08 +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
|
||||
process_revisions_for_item(main_item, data.item.content)
|
||||
|
||||
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(
|
||||
collection=instance,
|
||||
|
Loading…
Reference in New Issue
Block a user