fix pyrogram task
This commit is contained in:
parent
5306a033b2
commit
dac3e21a00
@ -4,7 +4,7 @@ from tempfile import TemporaryDirectory
|
||||
|
||||
import pytz
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.db import models, transaction
|
||||
from pyrogram import Chat as PyrogramChat, Message as PyrogramMessage
|
||||
|
||||
|
||||
@ -49,6 +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)
|
||||
return obj
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user