Implement more validation and conversion
This commit is contained in:
@@ -14,7 +14,13 @@ log = logs.get_logger(__name__)
|
||||
|
||||
|
||||
class AccountInfo(LoginRequiredMixin, View):
|
||||
VIEWABLE_FIELDS_MODEL = ["name", "exchange", "api_key", "sandbox"]
|
||||
VIEWABLE_FIELDS_MODEL = [
|
||||
"name",
|
||||
"exchange",
|
||||
"api_key",
|
||||
"sandbox",
|
||||
"supported_symbols",
|
||||
]
|
||||
allowed_types = ["modal", "widget", "window", "page"]
|
||||
window_content = "window-content/account-info.html"
|
||||
|
||||
@@ -45,6 +51,7 @@ class AccountInfo(LoginRequiredMixin, View):
|
||||
account_info = {
|
||||
k: v for k, v in account_info.items() if k in self.VIEWABLE_FIELDS_MODEL
|
||||
}
|
||||
account_info["supported_symbols"] = ", ".join(account_info["supported_symbols"])
|
||||
|
||||
if type == "page":
|
||||
type = "modal"
|
||||
|
||||
Reference in New Issue
Block a user