From b492e133c628cbdd8c70fb2b05caeec60e3f8a53 Mon Sep 17 00:00:00 2001
From: Eliot Berriot <contact@eliotberriot.com>
Date: Wed, 21 Feb 2018 00:03:37 +0100
Subject: [PATCH] Job signal to update batch status

---
 api/funkwhale_api/music/models.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/api/funkwhale_api/music/models.py b/api/funkwhale_api/music/models.py
index 3c6f60165..308bc43cc 100644
--- a/api/funkwhale_api/music/models.py
+++ b/api/funkwhale_api/music/models.py
@@ -461,3 +461,8 @@ class ImportJob(models.Model):
 
     class Meta:
         ordering = ('id', )
+
+
+@receiver(post_save, sender=ImportJob)
+def update_batch_status(sender, instance, **kwargs):
+    instance.batch.update_status()
-- 
GitLab