Remove labels from output of list_premium_lists (#1182)

* Remove labels from output of list_premium_lists

Remove the ability to show all of the labels associated with a premium list in
the list_premium_lists command.  Supporting this requires loading the entire
contents of all premium lists from the database as opposed to just the list
records, and the information can be obtained using get_premium_list.
This commit is contained in:
Michael Muller 2021-05-27 10:39:15 -04:00 committed by GitHub
parent 64cbaf17ff
commit 7763d3f292
2 changed files with 0 additions and 24 deletions

View file

@ -19,7 +19,6 @@ import static google.registry.persistence.transaction.TransactionManagerFactory.
import static google.registry.request.Action.Method.GET; import static google.registry.request.Action.Method.GET;
import static google.registry.request.Action.Method.POST; import static google.registry.request.Action.Method.POST;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import google.registry.model.registry.label.PremiumList; import google.registry.model.registry.label.PremiumList;
import google.registry.request.Action; import google.registry.request.Action;
@ -58,16 +57,6 @@ public final class ListPremiumListsAction extends ListObjectsAction<PremiumList>
.map(PremiumListDao::getLatestRevision) .map(PremiumListDao::getLatestRevision)
.filter(Optional::isPresent) .filter(Optional::isPresent)
.map(Optional::get) .map(Optional::get)
.peek(list -> list.getLabelsToPrices())
.collect(toImmutableSortedSet(Comparator.comparing(PremiumList::getName)))); .collect(toImmutableSortedSet(Comparator.comparing(PremiumList::getName))));
} }
/**
* Provide a field override for labelsToPrices, since it is an {@code Insignificant} field and
* doesn't get returned from {@link google.registry.model.ImmutableObject#toDiffableFieldMap}.
*/
@Override
public ImmutableMap<String, String> getFieldOverrides(PremiumList list) {
return ImmutableMap.of("labelsToPrices", list.getLabelsToPrices().toString());
}
} }

View file

@ -43,19 +43,6 @@ class ListPremiumListsActionTest extends ListActionTestCase {
"^xn--q9jyb4c$"); "^xn--q9jyb4c$");
} }
@Test
void testRun_withLabelsToPrices() {
testRunSuccess(
action,
Optional.of("labelsToPrices"),
Optional.empty(),
Optional.empty(),
"^name\\s+labelsToPrices\\s*$",
"^-+\\s+-+\\s*$",
"^how\\s+\\{richer=5000.00\\}$",
"^xn--q9jyb4c\\s+\\{rich=100\\.00\\}\\s+$");
}
@Test @Test
void testRun_withBadField_returnsError() { void testRun_withBadField_returnsError() {
testRunError( testRunError(