Skip to content

Commit

Permalink
chore: use the related data model for filtering status
Browse files Browse the repository at this point in the history
Signed-off-by: SeSo <[email protected]>
  • Loading branch information
Sepehr-Sobhani committed Nov 19, 2024
1 parent d5bd480 commit 31701f9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_approved_user_operator(cls, user: User) -> Optional[UserOperator]:
def get_admin_user_operator_requests_for_irc_users(cls) -> QuerySet[UserOperator]:
# Base query excluding operators with status 'Declined'
qs = UserOperator.objects.select_related("user", "operator").exclude(
operator__status=UserOperator.Statuses.DECLINED
operator__status=Operator.Statuses.DECLINED
)
# Subquery to check if an approved admin user exists for the operator
approved_admin_operator_exists = UserOperator.objects.filter(
Expand Down

0 comments on commit 31701f9

Please sign in to comment.