mirror of
https://github.com/google/nomulus
synced 2026-01-09 07:33:42 +00:00
Remove the ofy().load() inside of HostResource.cloneProjectedAtTime
In fact, completely eviscerate cloneProjectedAtTime (to be removed in a followup CL) in favor of doing the projection of transfers and the loading of values from the superordinate domain at call sites. This is one of the issues that blocked the memcache audit work, since the load inside of cloneProjectedAtTime could not be controlled by the caller. Note: fixed a minor bug where a subordinate host created after its superordinate domain was last transferred should have lastTransferTime==null but was previously reporting the domain's lastTransferTime. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149769125
This commit is contained in:
@@ -33,6 +33,7 @@ import google.registry.flows.FlowModule.Superuser;
|
||||
import google.registry.flows.FlowModule.TargetId;
|
||||
import google.registry.flows.TransactionalFlow;
|
||||
import google.registry.flows.async.AsyncFlowEnqueuer;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.metadata.MetadataExtension;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
@@ -93,7 +94,14 @@ public final class HostDeleteFlow implements TransactionalFlow {
|
||||
HostResource existingHost = loadAndVerifyExistence(HostResource.class, targetId, now);
|
||||
verifyNoDisallowedStatuses(existingHost, DISALLOWED_STATUSES);
|
||||
if (!isSuperuser) {
|
||||
verifyResourceOwnership(clientId, existingHost);
|
||||
// Hosts transfer with their superordinate domains, so for hosts with a superordinate domain,
|
||||
// the client id, needs to be read off of it.
|
||||
EppResource owningResource =
|
||||
existingHost.isSubordinate()
|
||||
? ofy().load().key(existingHost.getSuperordinateDomain()).now()
|
||||
.cloneProjectedAtTime(now)
|
||||
: existingHost;
|
||||
verifyResourceOwnership(clientId, owningResource);
|
||||
}
|
||||
asyncFlowEnqueuer.enqueueAsyncDelete(existingHost, clientId, isSuperuser);
|
||||
HostResource newHost =
|
||||
|
||||
Reference in New Issue
Block a user