revert get_valid_partner_authorizations move, but keep updated comments.
@@ -693,16 +693,14 @@ class AuthorizedUsers(APIView):
# We're ignoring streams here, because the API operates at the partner
# level. This is fine for the use case we built it for (Wikilink tool)
- valid_partner_auths = None
+ valid_partner_auths = get_valid_partner_authorizations(pk)
# For Bundle partners, get auths for users who logged in within the last 2 weeks.
if partner.authorization_method == partner.BUNDLE:
valid_partner_auths = valid_partner_auths.filter(
user__last_login__gt=timezone.now() - timedelta(weeks=2)
)
- # Otherwise, get all valid auths for this partner.
- else:
- valid_partner_auths = get_valid_partner_authorizations(pk)
+
users = User.objects.filter(authorizations__in=valid_partner_auths).distinct()
serializer = UserSerializer(users, many=True)
