From 6dfa2360c090e6f0768b63146d108dae91d23293 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 15 Apr 2020 16:52:36 +0300 Subject: [PATCH] Chunk: fix for a collection's main item. --- django_etesync/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django_etesync/models.py b/django_etesync/models.py index 65f130a..fdf8041 100644 --- a/django_etesync/models.py +++ b/django_etesync/models.py @@ -64,7 +64,8 @@ def chunk_directory_path(instance, filename): item = instance.item col = item.collection user_id = col.owner.id - return Path('user_{}'.format(user_id), col.uid, item.uid, instance.uid) + item_uid = item.uid or 'main' + return Path('user_{}'.format(user_id), col.uid, item_uid, instance.uid) class CollectionItemChunk(models.Model):