From 92e032fd2cd381f741c9f2d7db2899a7d6dc2f2d Mon Sep 17 00:00:00 2001 From: Rebecca Cremona Date: Wed, 4 Dec 2024 18:17:48 -0500 Subject: [PATCH] Whitespace, comment. --- perma_web/perma/forms.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/perma_web/perma/forms.py b/perma_web/perma/forms.py index cde11af79..b7fb664fb 100755 --- a/perma_web/perma/forms.py +++ b/perma_web/perma/forms.py @@ -531,18 +531,19 @@ def clean_csv_file(self): def save(self, commit=True): expires_at = self.cleaned_data['expires_at'] organization = self.cleaned_data['organizations'] - affiliations_to_create = [] all_emails = set(self.user_data.keys()) - existing_users = LinkUser.objects.filter(email__in=all_emails) + affiliations_to_create = [] + # find any existing users, and exclude any that are ineligible to become org users + existing_users = LinkUser.objects.filter(email__in=all_emails) for user in existing_users: if user.is_staff or user.is_registrar_user(): self.ineligible_users[user.email] = user else: self.updated_users[user.email] = user - # update the expiration date of any affiliations that already exist + # update the affiliation expiration date for any already-affiliated users preexisting_affiliations = UserOrganizationAffiliation.objects.filter( user__in=self.updated_users.values(), organization=organization