Skip to content

Commit

Permalink
don't compute courts facet, it's not used
Browse files Browse the repository at this point in the history
  • Loading branch information
longhotsummer committed Sep 8, 2023
1 parent 1a82001 commit b142949
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
11 changes: 0 additions & 11 deletions peachjam/js/components/ListFacets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<!-- DOM Hack for i18next to parse facet to locale json. i18next skips t functions in script element -->
<div v-if="false">
{{ $t('Alphabetical') }}
{{ $t('Court') }}
{{ $t('Document type') }}
{{ $t('Judges') }}
{{ $t('Attorneys') }}
Expand All @@ -37,10 +36,6 @@ export default {
type: Array,
default: () => []
},
courts: {
type: Array,
default: () => []
},
alphabet: {
type: Array,
default: () => []
Expand Down Expand Up @@ -130,12 +125,6 @@ export default {
type: 'radio',
title: JSON.parse(document.querySelector('#data-labels').textContent).author
},
{
name: 'courts',
type: 'radio',
title: this.$t('Court')
},
{
name: 'docTypes',
type: 'radio',
Expand Down
16 changes: 0 additions & 16 deletions peachjam/views/generic_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
CitationLink,
CoreDocument,
GenericDocument,
Judgment,
LegalInstrument,
Predicate,
Relationship,
Expand Down Expand Up @@ -66,8 +65,6 @@ def get_context_data(self, **kwargs):

def add_facets(self, context):
authors = []
courts = []
natures = []
# Initialize facet data values
natures = list(
{
Expand All @@ -89,18 +86,6 @@ def add_facets(self, context):
}
)

# Legislation objects don't have an associated author, hence empty authors list
if self.model is Judgment:
courts = list(
{
a
for a in self.form.filter_queryset(
self.get_base_queryset(), exclude="courts"
).values_list("court__name", flat=True)
if a
}
)

years = list(
set(
self.form.filter_queryset(
Expand All @@ -114,7 +99,6 @@ def add_facets(self, context):
context["facet_data"] = {
"years": years,
"authors": authors,
"courts": courts,
"alphabet": lowercase_alphabet(),
"natures": natures,
}
Expand Down

0 comments on commit b142949

Please sign in to comment.