diff --git a/apps/accounts/automations/gather_account/manager.py b/apps/accounts/automations/gather_account/manager.py index 74a2457eb..28fecab53 100644 --- a/apps/accounts/automations/gather_account/manager.py +++ b/apps/accounts/automations/gather_account/manager.py @@ -359,6 +359,8 @@ class GatherAccountsManager(AccountBasePlaybookManager): self.update_gathered_account(ori_account, d) risk_analyser.analyse_risk(asset, ori_account, d) + self.create_gathered_account.finish() + self.update_gathered_account.finish() self.update_gather_accounts_status(asset) GatheredAccount.sync_accounts(gathered_accounts, self.is_sync_account) # 因为有 bulk create, bulk update, 所以这里需要 sleep 一下,等待数据同步 diff --git a/apps/accounts/migrations/0017_alter_accountrisk_status_and_more.py b/apps/accounts/migrations/0017_alter_accountrisk_status_and_more.py new file mode 100644 index 000000000..d2f917c55 --- /dev/null +++ b/apps/accounts/migrations/0017_alter_accountrisk_status_and_more.py @@ -0,0 +1,35 @@ +# Generated by Django 4.1.13 on 2024-12-02 02:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("accounts", "0016_alter_accountrisk_status_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="accountrisk", + name="status", + field=models.CharField( + blank=True, + choices=[("0", "Pending"), ("1", "Confirmed"), ("2", "Ignored")], + default="0", + max_length=32, + verbose_name="Status", + ), + ), + migrations.AlterField( + model_name="gatheredaccount", + name="status", + field=models.CharField( + blank=True, + choices=[("0", "Pending"), ("1", "Confirmed"), ("2", "Ignored")], + default="0", + max_length=32, + verbose_name="Status", + ), + ), + ] diff --git a/apps/common/const/choices.py b/apps/common/const/choices.py index 16049fc54..8158f874f 100644 --- a/apps/common/const/choices.py +++ b/apps/common/const/choices.py @@ -76,9 +76,9 @@ class Language(models.TextChoices): class ConfirmOrIgnore(models.TextChoices): - pending = '', _('Pending') - confirmed = 'confirmed', _('Confirmed') - ignored = 'ignored', _('Ignored') + pending = '0', _('Pending') + confirmed = '1', _('Confirmed') + ignored = '2', _('Ignored') COUNTRY_CALLING_CODES = get_country_phone_choices()