diff --git a/apps/assets/migrations/0099_auto_20220426_1558.py b/apps/assets/migrations/0099_auto_20220426_1558.py index 8d888cf6b..6d3bb23a4 100644 --- a/apps/assets/migrations/0099_auto_20220426_1558.py +++ b/apps/assets/migrations/0099_auto_20220426_1558.py @@ -18,6 +18,9 @@ def create_app_platform(apps, *args): {'name': 'MongoDB', 'category': 'database', 'type': 'mongodb'}, {'name': 'Redis', 'category': 'database', 'type': 'redis'}, {'name': 'Chrome', 'category': 'remote_app', 'type': 'chrome'}, + {'name': 'MysqlWorkbench', 'category': 'remote_app', 'type': 'mysql_workbench'}, + {'name': 'VmwareClient', 'category': 'remote_app', 'type': 'vmware_client'}, + {'name': 'General', 'category': 'remote_app', 'type': 'general_remote_app'}, {'name': 'Kubernetes', 'category': 'cloud', 'type': 'k8s'}, ] diff --git a/apps/assets/serializers/account_template.py b/apps/assets/serializers/account_template.py index ba25ac8dd..0762789fd 100644 --- a/apps/assets/serializers/account_template.py +++ b/apps/assets/serializers/account_template.py @@ -8,12 +8,15 @@ from .account import AccountSerializer class AccountTemplateSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer): class Meta: model = AccountTemplate - fields_mini = ['id', 'privileged', 'username'] + fields_mini = ['id', 'privileged', 'username', 'name'] fields_write_only = AccountSerializer.Meta.fields_write_only fields_other = AccountSerializer.Meta.fields_other fields = fields_mini + fields_write_only + fields_other extra_kwargs = AccountSerializer.Meta.extra_kwargs def validate(self, attrs): + print(attrs) + + raise ValueError('test') attrs = self._validate_gen_key(attrs) return attrs diff --git a/apps/assets/serializers/base.py b/apps/assets/serializers/base.py index aba1ddfe8..9e4192fb3 100644 --- a/apps/assets/serializers/base.py +++ b/apps/assets/serializers/base.py @@ -75,7 +75,8 @@ class AuthSerializerMixin(serializers.ModelSerializer): validated_data.pop(field, None) validated_data.pop('passphrase', None) - def _validate_gen_key(self, attrs): + @staticmethod + def _validate_gen_key(attrs): private_key = attrs.get('private_key') if not private_key: return attrs diff --git a/apps/authentication/migrations/0012_auto_20220816_1629.py b/apps/authentication/migrations/0012_auto_20220816_1629.py index dac9d1302..6e22b0e0f 100644 --- a/apps/authentication/migrations/0012_auto_20220816_1629.py +++ b/apps/authentication/migrations/0012_auto_20220816_1629.py @@ -10,7 +10,7 @@ def migrate_system_user_to_account(apps, schema_editor): while True: connection_tokens = connection_token_model.objects \ - .prefetch_related('system_users')[count:bulk_size] + .prefetch_related('system_user')[count:bulk_size] if not connection_tokens: break count += len(connection_tokens)