invites: Use the realm on the PreregistrationUser, to save a join.

This commit is contained in:
Alex Vandiver 2024-07-10 17:09:10 +00:00 committed by Tim Abbott
parent 2bc118892a
commit ab1e858eb9
1 changed files with 1 additions and 1 deletions

View File

@ -301,7 +301,7 @@ def do_get_invites_controlled_by_user(user_profile: UserProfile) -> list[dict[st
""" """
if user_profile.is_realm_admin: if user_profile.is_realm_admin:
prereg_users = filter_to_valid_prereg_users( prereg_users = filter_to_valid_prereg_users(
PreregistrationUser.objects.filter(referred_by__realm=user_profile.realm) PreregistrationUser.objects.filter(realm=user_profile.realm, referred_by__isnull=False)
) )
else: else:
prereg_users = filter_to_valid_prereg_users( prereg_users = filter_to_valid_prereg_users(