mirror of
https://github.com/google/nomulus
synced 2026-01-05 04:56:03 +00:00
Replace loadByUniqueId() with methods that don't overload unique id
It is replaced by loadByForeignKey(), which does the same thing that loadByUniqueId() did for contacts, hosts, and domains, and also loadDomainApplication(), which loads domain application by ROID. This eliminates the ugly mode-switching of attemping to load by other foreign key or ROID. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133980156
This commit is contained in:
@@ -16,7 +16,7 @@ package google.registry.tools;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static google.registry.model.EppResourceUtils.loadByUniqueId;
|
||||
import static google.registry.model.EppResourceUtils.loadDomainApplication;
|
||||
import static google.registry.model.domain.launch.ApplicationStatus.ALLOCATED;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
|
||||
@@ -89,8 +89,7 @@ final class UpdateApplicationStatusCommand extends MutatingCommand {
|
||||
DateTime now = ofy().getTransactionTime();
|
||||
|
||||
// Load the domain application.
|
||||
DomainApplication domainApplication =
|
||||
loadByUniqueId(DomainApplication.class, applicationId, now);
|
||||
DomainApplication domainApplication = loadDomainApplication(applicationId, now);
|
||||
checkArgumentNotNull(domainApplication, "Domain application does not exist");
|
||||
|
||||
// It's not an error if the application already has the intended status. We want the method
|
||||
|
||||
Reference in New Issue
Block a user