diff --git a/apps/accounts/api/automations/push_account.py b/apps/accounts/api/automations/push_account.py index b91bad379..76caff498 100644 --- a/apps/accounts/api/automations/push_account.py +++ b/apps/accounts/api/automations/push_account.py @@ -2,19 +2,17 @@ # from accounts import serializers from accounts.const import AutomationTypes -from accounts.models import PushAccountAutomation, ChangeSecretRecord +from accounts.models import PushAccountAutomation from orgs.mixins.api import OrgBulkModelViewSet from .base import ( AutomationAssetsListApi, AutomationRemoveAssetApi, AutomationAddAssetApi, AutomationNodeAddRemoveApi, AutomationExecutionViewSet ) -from .change_secret import ChangeSecretRecordViewSet __all__ = [ 'PushAccountAutomationViewSet', 'PushAccountAssetsListApi', 'PushAccountRemoveAssetApi', 'PushAccountAddAssetApi', 'PushAccountNodeAddRemoveApi', 'PushAccountExecutionViewSet', - 'PushAccountRecordViewSet' ] @@ -41,23 +39,6 @@ class PushAccountExecutionViewSet(AutomationExecutionViewSet): return queryset -class PushAccountRecordViewSet(ChangeSecretRecordViewSet): - serializer_class = serializers.ChangeSecretRecordSerializer - tp = AutomationTypes.push_account - - rbac_perms = { - 'list': 'accounts.view_pushsecretrecord', - 'execute': 'accounts.add_pushsecretexecution', - 'secret': 'accounts.view_pushsecretrecord', - } - - def get_queryset(self): - qs = ChangeSecretRecord.get_valid_records() - return qs.filter( - execution__automation__type=self.tp - ) - - class PushAccountAssetsListApi(AutomationAssetsListApi): model = PushAccountAutomation diff --git a/apps/accounts/migrations/0023_alter_changesecretrecord_options.py b/apps/accounts/migrations/0023_alter_changesecretrecord_options.py new file mode 100644 index 000000000..1fb1addbe --- /dev/null +++ b/apps/accounts/migrations/0023_alter_changesecretrecord_options.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.13 on 2024-12-10 11:29 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounts', '0022_alter_changesecretrecord_options_and_more'), + ] + + operations = [ + migrations.AlterModelOptions( + name='changesecretrecord', + options={'verbose_name': 'Change secret record'}, + ), + ] diff --git a/apps/accounts/models/automations/change_secret.py b/apps/accounts/models/automations/change_secret.py index d79c6660c..a894f9d6d 100644 --- a/apps/accounts/models/automations/change_secret.py +++ b/apps/accounts/models/automations/change_secret.py @@ -46,10 +46,6 @@ class ChangeSecretRecord(JMSBaseModel): class Meta: verbose_name = _("Change secret record") - permissions = [ - ('view_pushsecretrecord', _('Can view change secret execution')), - ('add_pushsecretexecution', _('Can add change secret execution')), - ] def __str__(self): return f'{self.account.username}@{self.asset}' diff --git a/apps/accounts/urls.py b/apps/accounts/urls.py index e388e5a68..b9cfea710 100644 --- a/apps/accounts/urls.py +++ b/apps/accounts/urls.py @@ -23,7 +23,6 @@ router.register(r'gather-account-automations', api.GatherAccountsAutomationViewS router.register(r'gather-account-executions', api.GatherAccountsExecutionViewSet, 'gather-account-execution') router.register(r'push-account-automations', api.PushAccountAutomationViewSet, 'push-account-automation') router.register(r'push-account-executions', api.PushAccountExecutionViewSet, 'push-account-execution') -router.register(r'push-account-records', api.PushAccountRecordViewSet, 'push-account-record') router.register(r'check-account-automations', api.CheckAccountAutomationViewSet, 'check-account-automation') router.register(r'check-account-executions', api.CheckAccountExecutionViewSet, 'check-account-execution') router.register(r'account-check-engines', api.CheckAccountEngineViewSet, 'account-check-engine')