Skip to content

Commit

Permalink
upgrade to django 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
longhotsummer committed Jul 26, 2024
1 parent 0efc84d commit 1bbc300
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 14 deletions.
24 changes: 24 additions & 0 deletions peachjam/debugging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import threading

import debug_toolbar.utils


class ThreadCollector:
def __init__(self):
self.data = threading.local()
self.data.collection = []

def collect(self, item):
if hasattr(self.data, "collection"):
self.data.collection.append(item)

def get_collection(self):
return getattr(self.data, "collection", [])

def clear_collection(self):
self.data.collection = []


# monkey patch django debug toolbar so that elastic_panel's broken import still works
# see https://github.com/Benoss/django-elasticsearch-debug-toolbar/pull/21
debug_toolbar.utils.ThreadCollector = ThreadCollector
1 change: 1 addition & 0 deletions peachjam/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
INSTALLED_APPS.append("elastic_panel")
MIDDLEWARE.append("debug_toolbar.middleware.DebugToolbarMiddleware")
INTERNAL_IPS = ["127.0.0.1"]
import peachjam.debugging # noqa

# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
Expand Down
20 changes: 10 additions & 10 deletions peachjam/templates/peachjam/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,36 @@
type="application/atom+xml"
title="Atom RSS Feed"
href="{% url 'atom_feed' %}"/>
{% ifequal request.path '/judgments/' %}
{% if request.path == '/judgments/' %}
<link rel="alternate"
type="application/atom+xml"
title="Judgments Atom RSS Feed"
href="{% url 'judgment_feed' %}"/>
{% endifequal %}
{% ifequal request.path '/doc/' %}
{% endif %}
{% if request.path == '/doc/' %}
<link rel="alternate"
type="application/atom+xml"
title="AU Documents Atom RSS Feed"
href="{% url 'generic_document_feed' %}"/>
{% endifequal %}
{% ifequal request.path '/legal_instruments/' %}
{% endif %}
{% if request.path == '/legal_instruments/' %}
<link rel="alternate"
type="application/atom+xml"
title="Legal Instruments Atom RSS Feed"
href="{% url 'legal_instrument_feed' %}"/>
{% endifequal %}
{% ifequal request.path '/legislation/' %}
{% endif %}
{% if request.path == '/legislation/' %}
<link rel="alternate"
type="application/atom+xml"
title="Treaties & Protocols Atom RSS Feed"
href="{% url 'legislation_feed' %}"/>
{% endifequal %}
{% ifequal request.path '/articles/' %}
{% endif %}
{% if request.path == '/articles/' %}
<link rel="alternate"
type="application/atom+xml"
title="{{ APP_NAME }} Articles RSS Feed"
href="{% url 'article_feed' %}"/>
{% endifequal %}
{% endif %}
{% block favicon %}
<link rel="icon" type="image/ico" href="{% static 'images/favicon.ico' %}" />
<link rel="icon"
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ dependencies = [
"cobalt>=6.0.0",
"cssutils >= 2",
"dj-database-url>=0.5.0",
"Django~=3.2.13",
"django-advanced-password-validation==1.1.1",
"Django~=4.2",
"django-advanced-password-validation>=1.1",
"django-allauth[socialaccount]>=0.62.0",
"django-autocomplete-light>=3.9.7",
"django-background-tasks>=1.2.5",
"django-background-tasks-updated>=1.2.8",
"django-ckeditor>=6.4.2",
"django-compressor>=3.1",
"django-cors-headers>=4.3.1",
"django-countries-plus>=1.3.2",
"django-debug-toolbar>=3.2.4,<4.2.0",
"django-debug-toolbar>=4.4",
"django-elasticsearch-debug-toolbar>=3.0.2",
"django-elasticsearch-dsl>=7.2.2,<8.0.0",
"django-elasticsearch-dsl-drf>=0.22.4",
Expand Down

0 comments on commit 1bbc300

Please sign in to comment.