From 5e1167743f8009c9c0b64394f2ec31657fc57066 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 7 May 2023 12:06:55 +0700 Subject: [PATCH] fix migration notification logic --- .../config/management/commands/ta_startup.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tubearchivist/config/management/commands/ta_startup.py b/tubearchivist/config/management/commands/ta_startup.py index c65b39e..b5fa226 100644 --- a/tubearchivist/config/management/commands/ta_startup.py +++ b/tubearchivist/config/management/commands/ta_startup.py @@ -201,17 +201,17 @@ class Command(BaseCommand): response, status_code = ElasticWrap(path).post(data=data) if status_code == 200: updated = response.get("updated", 0) - if not updated: + if updated: + self.stdout.write( + self.style.SUCCESS( + f" ✓ {updated} videos updated in ta_download" + ) + ) + else: self.stdout.write( " no videos needed updating in ta_download" ) - return - - self.stdout.write( - self.style.SUCCESS( - f" ✓ {updated} videos updated in ta_download" - ) - ) + return message = " 🗙 ta_download auto_start update failed" self.stdout.write(self.style.ERROR(message))