Skip to content

Commit

Permalink
Improve query operations
Browse files Browse the repository at this point in the history
  • Loading branch information
faucomte97 committed Aug 6, 2024
1 parent 9b93652 commit 6c3d1fe
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions portal/views/cron/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,7 @@ def get_inactive_users(days: int) -> QuerySet[User]:
)
)

teacher_queryset = user_queryset.filter(
new_teacher__isnull=False,
new_student__isnull=True,
)
independent_student_queryset = user_queryset.filter(
new_teacher__isnull=True,
new_student__class_field__isnull=True,
)

return teacher_queryset.union(independent_student_queryset)
return user_queryset.exclude(email__isnull=True).exclude(email="")


def build_absolute_google_uri(request, location: str) -> str:
Expand Down

0 comments on commit 6c3d1fe

Please sign in to comment.