Implement strategies and posting trades

This commit is contained in:
2022-10-27 18:08:40 +01:00
parent 7e4f3f52d1
commit 061c6f6ca7
32 changed files with 1060 additions and 178 deletions

View File

@@ -34,7 +34,7 @@ class AccountInfo(LoginRequiredMixin, View):
template_name = f"wm/{type}.html"
unique = str(uuid.uuid4())[:8]
try:
account = Account.objects.get(id=account_id, user=request.user)
account = Account.get_by_id(account_id, request.user)
except Account.DoesNotExist:
message = "Account does not exist"
message_class = "danger"
@@ -45,7 +45,7 @@ class AccountInfo(LoginRequiredMixin, View):
}
return render(request, template_name, context)
live_info = dict(account.get_account())
live_info = dict(account.client.get_account())
account_info = account.__dict__
account_info = {
k: v for k, v in account_info.items() if k in self.VIEWABLE_FIELDS_MODEL
@@ -141,7 +141,8 @@ class AccountAction(LoginRequiredMixin, APIView):
if account_id:
try:
form = AccountForm(
request.data, instance=Account.objects.get(id=account_id)
request.data,
instance=Account.objects.get(id=account_id, user=request.user),
)
except Account.DoesNotExist:
message = "Account does not exist"