Implement strategies and posting trades
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user