Allow disabling accounts
This commit is contained in:
@@ -53,7 +53,8 @@ class Positions(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
||||
if account_id:
|
||||
self.extra_context["account_id"] = account_id
|
||||
items = []
|
||||
accounts = Account.objects.filter(user=self.request.user)
|
||||
# Only get enabled accounts for positions
|
||||
accounts = Account.objects.filter(user=self.request.user, enabled=True)
|
||||
for account in accounts:
|
||||
try:
|
||||
positions = account.client.get_all_positions()
|
||||
|
||||
@@ -22,7 +22,8 @@ class Profit(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
||||
|
||||
def get_queryset(self, **kwargs):
|
||||
items = []
|
||||
accounts = Account.objects.filter(user=self.request.user)
|
||||
# Only get enabled accounts
|
||||
accounts = Account.objects.filter(user=self.request.user, enabled=True)
|
||||
for account in accounts:
|
||||
try:
|
||||
details = account.client.get_account()
|
||||
|
||||
Reference in New Issue
Block a user