Skip to content

Commit

Permalink
Use custom manager methods to access queryset of active accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
amstilp committed May 30, 2024
1 parent 3a9d9e1 commit 6ef2ae1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion anvil_consortium_manager/audit/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class AccountAudit(AnVILAudit):

def run_audit(self):
# Only checks active accounts.
for account in models.Account.objects.filter(status=models.Account.ACTIVE_STATUS).all():
for account in models.Account.objects.active():
model_instance_result = ModelInstanceResult(account)
if not account.anvil_exists():
model_instance_result.add_error(self.ERROR_NOT_IN_ANVIL)
Expand Down
2 changes: 1 addition & 1 deletion anvil_consortium_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ def get_selected_result_label(self, item):

def get_queryset(self):
# Only active accounts.
qs = models.Account.objects.filter(status=models.Account.ACTIVE_STATUS).order_by("email")
qs = models.Account.objects.active().order_by("email")

# Use the account adapter to process the query.
adapter = get_account_adapter()
Expand Down

0 comments on commit 6ef2ae1

Please sign in to comment.