mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Fall back to icannReferralEmail when creating registrars through the command line
This is if the separate email field isn't specified. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=239504636
This commit is contained in:
parent
1e2a60a390
commit
0ead4f8d9d
3 changed files with 44 additions and 20 deletions
|
@ -92,12 +92,8 @@ abstract class CreateOrUpdateRegistrarCommand extends MutatingCommand {
|
|||
String registrarName;
|
||||
|
||||
@Nullable
|
||||
@Parameter(
|
||||
names = "--email",
|
||||
description = "Email address of registrar",
|
||||
converter = OptionalStringParameter.class,
|
||||
validateWith = OptionalStringParameter.class)
|
||||
Optional<String> email;
|
||||
@Parameter(names = "--email", description = "Email address of registrar")
|
||||
String email;
|
||||
|
||||
@Nullable
|
||||
@Parameter(
|
||||
|
@ -280,8 +276,11 @@ abstract class CreateOrUpdateRegistrarCommand extends MutatingCommand {
|
|||
if (!isNullOrEmpty(registrarName)) {
|
||||
builder.setRegistrarName(registrarName);
|
||||
}
|
||||
if (email != null) {
|
||||
builder.setEmailAddress(email.orElse(null));
|
||||
if (!isNullOrEmpty(email)) {
|
||||
builder.setEmailAddress(email);
|
||||
} else if (!isNullOrEmpty(
|
||||
icannReferralEmail)) { // fall back to ICANN referral email if present
|
||||
builder.setEmailAddress(icannReferralEmail);
|
||||
}
|
||||
if (url != null) {
|
||||
builder.setUrl(url.orElse(null));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue