Skip to content

Commit

Permalink
fix court entity profile lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
longhotsummer committed Sep 5, 2024
1 parent 787ae48 commit 32a194e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 0 additions & 7 deletions peachjam/templates/peachjam/court_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@
</nav>
</div>
{% endblock %}
{% block entity-profile %}
{% with entity_profile=court.entity_profile.first entity_profile_title=court.name %}
{% if entity_profile %}
{% include 'peachjam/_entity_profile.html' %}
{% endif %}
{% endwith %}
{% endblock %}
{% block page-title %}
{% if not entity_profile %}<h1 class="mt-4">{{ page_title }}</h1>{% endif %}
{% endblock %}
Expand Down
4 changes: 4 additions & 0 deletions peachjam/views/courts.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ def get_context_data(self, **kwargs):
context["all_years_url"] = self.court.get_absolute_url()
return context

def add_entity_profile(self, context):
context["entity_profile"] = self.court.entity_profile.first()
context["entity_profile_title"] = self.court.name


class CourtYearView(YearMixin, CourtDetailView):
def get_context_data(self, **kwargs):
Expand Down

0 comments on commit 32a194e

Please sign in to comment.