Skip to content

Commit

Permalink
migrations: Fix confusing output for migration 0383.
Browse files Browse the repository at this point in the history
* Don't print the empty list for the vast majority of realms where
  this is a noop.

* Make output a little more clear that this isn't revoking all
  Confirmations, just those associated with deactivated users.
timabbott committed Mar 22, 2022
1 parent 3f0b0ee commit ceb9dd5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -52,7 +52,12 @@ def get_valid_invite_confirmations_generated_by_users(
is_active=False, realm_id=realm_id
).values_list("id", flat=True)
confirmation_ids = get_valid_invite_confirmations_generated_by_users(deactivated_user_ids)
print(f"Revoking Confirmations for realm {realm_id}: {confirmation_ids}")

if len(confirmation_ids) > 0:
print(
f"Revoking invitations by deactivated users in realm {realm_id}: {confirmation_ids}"
)

Confirmation.objects.filter(id__in=confirmation_ids).update(expiry_date=timezone_now())


0 comments on commit ceb9dd5

Please sign in to comment.