mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Don't delete or "redeem" unlimited use AllocationTokens
We haven't started dealing with timing or discounts yet, but unlimited use tokens should actually be unlimited use ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=243318266
This commit is contained in:
parent
416a39b003
commit
d1e3194fce
5 changed files with 44 additions and 3 deletions
|
@ -17,6 +17,7 @@ package google.registry.tools;
|
|||
import static com.google.common.collect.ImmutableSet.toImmutableSet;
|
||||
import static com.google.common.collect.Iterables.partition;
|
||||
import static com.google.common.collect.Streams.stream;
|
||||
import static google.registry.model.domain.token.AllocationToken.TokenType.SINGLE_USE;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
|
@ -93,6 +94,7 @@ final class DeleteAllocationTokensCommand extends ConfirmingCommand
|
|||
ImmutableSet<AllocationToken> tokensToDelete =
|
||||
ofy().load().keys(batch).values().stream()
|
||||
.filter(t -> withDomains || !t.getDomainName().isPresent())
|
||||
.filter(t -> SINGLE_USE.equals(t.getTokenType()))
|
||||
.filter(t -> !t.isRedeemed())
|
||||
.collect(toImmutableSet());
|
||||
if (!dryRun) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue