From fc61dea9b569c3a079810777cca9510050ffbb04 Mon Sep 17 00:00:00 2001 From: liuzheng712 Date: Mon, 26 Feb 2018 18:11:46 +0800 Subject: [PATCH] fix: app get replay storage --- apps/terminal/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/terminal/models.py b/apps/terminal/models.py index 614175684..23cb70f8e 100644 --- a/apps/terminal/models.py +++ b/apps/terminal/models.py @@ -45,7 +45,12 @@ class Terminal(models.Model): return {"TERMINAL_COMMAND_STORAGE": storage} def get_replay_storage(self): - pass + storage_all = settings.TERMINAL_REPLAY_STORAGE + if self.replay_storage in storage_all: + storage = storage_all.get(self.replay_storage) + else: + storage = storage_all.get('default') + return {"TERMINAL_REPLAY_STORAGE": storage} @property def config(self): @@ -54,6 +59,7 @@ class Terminal(models.Model): if k.startswith('TERMINAL'): configs[k] = getattr(settings, k) configs.update(self.get_common_storage()) + configs.update(self.get_replay_storage()) return configs def create_app_user(self): -- GitLab