filter message ids in dump
This commit is contained in:
@@ -265,10 +265,15 @@ class QueuedItem(models.Model):
|
|||||||
datetime = models.DateTimeField(auto_now_add=True)
|
datetime = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
def __json__(self):
|
def __json__(self):
|
||||||
|
message_ids = []
|
||||||
|
if self.message_id:
|
||||||
|
message_ids.append(self.message_id)
|
||||||
|
if self.message_ids_extra:
|
||||||
|
message_ids.extend(int(i) for i in self.message_ids_extra.split('|') if i.isdigit())
|
||||||
return {
|
return {
|
||||||
'type': self.type,
|
'type': self.type,
|
||||||
'file_id': json.loads(self.args)[0],
|
'file_id': json.loads(self.args)[0],
|
||||||
'message_ids': [self.message_id] + list(self.message_ids_extra.split('|') if self.message_ids_extra else []),
|
'message_ids': message_ids,
|
||||||
'processed': self.processed,
|
'processed': self.processed,
|
||||||
'datetime': self.datetime.isoformat(),
|
'datetime': self.datetime.isoformat(),
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user