mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Do not cancel pending transfers unless there is one to cancel
A previous CL inadvertently caused the system to always set the transfer status to SERVER_CANCELLED when deleting a resource, even if there was no transfer. This led to RDE problems. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=140890919
This commit is contained in:
parent
7cf29366bc
commit
c0d9b54872
5 changed files with 37 additions and 7 deletions
|
@ -14,6 +14,7 @@
|
|||
|
||||
package google.registry.flows;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static com.google.common.collect.Iterables.tryFind;
|
||||
|
@ -214,6 +215,7 @@ public final class ResourceFlowUtils {
|
|||
*/
|
||||
public static TransferData createResolvedTransferData(
|
||||
TransferData oldTransferData, TransferStatus transferStatus, DateTime now) {
|
||||
checkArgument(!oldTransferData.equals(TransferData.EMPTY), "No old transfer to resolve.");
|
||||
return oldTransferData.asBuilder()
|
||||
.setExtendedRegistrationYears(null)
|
||||
.setServerApproveEntities(null)
|
||||
|
@ -238,6 +240,9 @@ public final class ResourceFlowUtils {
|
|||
R extends EppResource & ResourceWithTransferData,
|
||||
B extends EppResource.Builder<R, B> & BuilderWithTransferData<B>> B resolvePendingTransfer(
|
||||
R resource, TransferStatus transferStatus, DateTime now) {
|
||||
checkState(
|
||||
resource.getStatusValues().contains(StatusValue.PENDING_TRANSFER),
|
||||
"Resource is not in pending transfer status.");
|
||||
return ((B) resource.asBuilder())
|
||||
.removeStatusValue(StatusValue.PENDING_TRANSFER)
|
||||
.setTransferData(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue