Implement viewing open positions
This commit is contained in:
@@ -18,6 +18,7 @@ def get_accounts(user):
|
||||
accounts = Account.objects.filter(user=user)
|
||||
return accounts
|
||||
|
||||
|
||||
class AccountInfo(LoginRequiredMixin, View):
|
||||
VIEWABLE_FIELDS_MODEL = ["name", "exchange", "api_key", "sandbox"]
|
||||
allowed_types = ["modal", "widget", "window", "page"]
|
||||
@@ -46,7 +47,9 @@ class AccountInfo(LoginRequiredMixin, View):
|
||||
|
||||
live_info = dict(account.get_account())
|
||||
account_info = account.__dict__
|
||||
account_info = {k:v for k,v in account_info.items() if k in self.VIEWABLE_FIELDS_MODEL}
|
||||
account_info = {
|
||||
k: v for k, v in account_info.items() if k in self.VIEWABLE_FIELDS_MODEL
|
||||
}
|
||||
|
||||
if type == "page":
|
||||
type = "modal"
|
||||
@@ -61,6 +64,7 @@ class AccountInfo(LoginRequiredMixin, View):
|
||||
|
||||
return render(request, template_name, context)
|
||||
|
||||
|
||||
class Accounts(LoginRequiredMixin, View):
|
||||
allowed_types = ["modal", "widget", "window", "page"]
|
||||
window_content = "window-content/accounts.html"
|
||||
|
||||
Reference in New Issue
Block a user