From 419381bd103cedb43845f629a510df2a71f4442c Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Fri, 17 Feb 2023 14:34:51 +0800 Subject: [PATCH] perf: account backup (#9603) Co-authored-by: feng <1304903146@qq.com> --- apps/accounts/api/account/backup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/accounts/api/account/backup.py b/apps/accounts/api/account/backup.py index 216cbd585..e8fcd87f6 100644 --- a/apps/accounts/api/account/backup.py +++ b/apps/accounts/api/account/backup.py @@ -3,13 +3,13 @@ from rest_framework import status, viewsets from rest_framework.response import Response -from orgs.mixins.api import OrgBulkModelViewSet -from common.const.choices import Trigger from accounts import serializers -from accounts.tasks import execute_account_backup_plan from accounts.models import ( AccountBackupAutomation, AccountBackupExecution ) +from accounts.tasks import execute_account_backup_plan +from common.const.choices import Trigger +from orgs.mixins.api import OrgBulkModelViewSet __all__ = [ 'AccountBackupPlanViewSet', 'AccountBackupPlanExecutionViewSet' @@ -39,5 +39,5 @@ class AccountBackupPlanExecutionViewSet(viewsets.ModelViewSet): serializer = self.get_serializer(data=request.data) serializer.is_valid(raise_exception=True) pid = serializer.data.get('plan') - task = execute_account_backup_plan.delay(pid=pid, trigger=Trigger.manual) + task = execute_account_backup_plan.delay(pid=str(pid), trigger=Trigger.manual) return Response({'task': task.id}, status=status.HTTP_201_CREATED)