fix: 修复终端更新存储失败的问题

pull/6358/head
Bai 2021-06-28 19:36:37 +08:00 committed by Jiangjie.Bai
parent 4fd7f0e949
commit 8ae6863266
2 changed files with 2 additions and 6 deletions

View File

@ -176,12 +176,6 @@ class Terminal(StorageMixin, TerminalStatusMixin, models.Model):
self.save()
return
def save(self, **kwargs):
from .storage import CommandStorage, ReplayStorage
self.command_storage = CommandStorage.default().name
self.replay_storage = ReplayStorage.default().name
return super().save(**kwargs)
def __str__(self):
status = "Active"
if not self.is_accepted:

View File

@ -119,5 +119,7 @@ class TerminalRegistrationSerializer(serializers.ModelSerializer):
instance.remote_addr = get_request_ip(request)
sa = self.service_account.save()
instance.user = sa
instance.command_storage = CommandStorage.default().name
instance.replay_storage = ReplayStorage.default().name
instance.save()
return instance