mirror of
https://github.com/google/nomulus.git
synced 2025-07-02 17:23:32 +02:00
Don't reset the update time for TLD updates (#1532)
* Don't reset the update time for TLD updates It turns out that the reason that the Registrar update timestamp isn't updated for some of the tests is because the record is updated unchanged. We can avoid this problem by not trying to update the registrar to the same value. So in this case, if the registrar alreay contains the TLD we're adding, don't try to add it.
This commit is contained in:
parent
f7b105e96b
commit
fbdee623de
2 changed files with 4 additions and 3 deletions
|
@ -825,7 +825,6 @@ public class Registrar extends ImmutableObject
|
|||
|
||||
public Builder setAllowedTlds(Set<String> allowedTlds) {
|
||||
getInstance().allowedTlds = ImmutableSortedSet.copyOf(assertTldsExist(allowedTlds));
|
||||
getInstance().lastUpdateTime = UpdateAutoTimestamp.create(null);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -472,8 +472,10 @@ public class DatabaseHelper {
|
|||
|
||||
public static void allowRegistrarAccess(String registrarId, String tld) {
|
||||
Registrar registrar = loadRegistrar(registrarId);
|
||||
persistResource(
|
||||
registrar.asBuilder().setAllowedTlds(union(registrar.getAllowedTlds(), tld)).build());
|
||||
if (!registrar.getAllowedTlds().contains(tld)) {
|
||||
persistResource(
|
||||
registrar.asBuilder().setAllowedTlds(union(registrar.getAllowedTlds(), tld)).build());
|
||||
}
|
||||
}
|
||||
|
||||
public static void disallowRegistrarAccess(String registrarId, String tld) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue