1
0
Fork 0

Updates for broadcast changes

This commit is contained in:
Mouse Reeve 2020-05-13 18:23:54 -07:00
parent e76f96eb6c
commit 3e02123a0d
3 changed files with 11 additions and 11 deletions

View file

@ -22,10 +22,10 @@ class FedireadsModel(models.Model):
abstract = True
@receiver(models.signals.post_save, sender=FedireadsModel)
@receiver(models.signals.post_save)
def execute_after_save(sender, instance, created, *args, **kwargs):
''' set the remote_id after save (when the id is available) '''
if not created:
if not created or not hasattr(instance, 'get_remote_id'):
return
instance.remote_id = instance.get_remote_id()
instance.save()