From 2fa592273d7537af1fe5c058bd1ce4455ec58d0b Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Wed, 30 Jan 2019 20:20:26 +0300 Subject: [PATCH] fix --- aggregator/models.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aggregator/models.py b/aggregator/models.py index 71b790e..831cfb4 100644 --- a/aggregator/models.py +++ b/aggregator/models.py @@ -49,8 +49,7 @@ class Chat(models.Model): obj.photo_id = chat.photo.small_file_id obj.save() if created: - transaction.commit() - collect_new_messages.delay(obj.pk) + transaction.on_commit(lambda: collect_new_messages.delay(obj.pk)) return obj def __str__(self):