From d7532594315474c09023dbcee711492660028e00 Mon Sep 17 00:00:00 2001 From: Nikhil <118773738+pablohashescobar@users.noreply.github.com> Date: Thu, 3 Oct 2024 13:44:44 +0530 Subject: [PATCH] chore: background job to sync license user task (#1324) --- .../plane/payment/management/__init__.py | 0 .../payment/management/commands/__init__.py | 0 .../management/commands/sync_license_user.py | 24 +++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 apiserver/plane/payment/management/__init__.py create mode 100644 apiserver/plane/payment/management/commands/__init__.py create mode 100644 apiserver/plane/payment/management/commands/sync_license_user.py diff --git a/apiserver/plane/payment/management/__init__.py b/apiserver/plane/payment/management/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/apiserver/plane/payment/management/commands/__init__.py b/apiserver/plane/payment/management/commands/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/apiserver/plane/payment/management/commands/sync_license_user.py b/apiserver/plane/payment/management/commands/sync_license_user.py new file mode 100644 index 0000000000..43f45373b8 --- /dev/null +++ b/apiserver/plane/payment/management/commands/sync_license_user.py @@ -0,0 +1,24 @@ +# Django imports +from django.core.management import BaseCommand + +# Module imports +from plane.payment.bgtasks.member_sync_task import member_sync_task + + +class Command(BaseCommand): + help = "Sync the license user for a workspace with the payment server" + + def handle(self, *args, **options): + # Get the slug of the workspace + workspace_slug = input("Enter the workspace slug: ") + + # Trigger the member sync task with the workspace slug + member_sync_task.delay(workspace_slug) + + # Print the success message + self.stdout.write( + self.style.SUCCESS( + f"Successfully triggered the member sync task for workspace: {workspace_slug}" + ) + ) + return