Skip to content

Commit 9131a4a

Browse files
committed
avoid debug keyword
1 parent f5976b2 commit 9131a4a

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Don't forget to remove deprecated code on each major release!
1919

2020
## [Unreleased]
2121

22-
- Nothing (yet)!
22+
### Fixed
23+
24+
- Fixed regression in v5.1.0 where components would sometimes not output debug messages when `settings.py:DEBUG` is enabled.
2325

2426
## [5.1.0] - 2024-11-24
2527

src/reactpy_django/templates/reactpy/component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% load static %}
22

3-
{% if reactpy_failure and debug %}
3+
{% if reactpy_failure and django_debug %}
44
<pre>{% firstof reactpy_error "UnknownError" %}: "{% firstof reactpy_dotted_path "UnknownPath" %}"</pre>
55
{% endif %}
66

src/reactpy_django/templates/reactpy/pyscript_setup.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% load static %}
22
<link rel="stylesheet" href="{% static 'reactpy_django/pyscript/core.css' %}" />
33
<link rel="stylesheet" href="{% static 'reactpy_django/pyscript-custom.css' %}" />
4-
{% if not debug %}
4+
{% if not django_debug %}
55
<link rel="stylesheet" href="{% static 'reactpy_django/pyscript-hide-debug.css' %}" />
66
{% endif %}
77
<script type="module" async crossorigin="anonymous" src="{% static 'reactpy_django/pyscript/core.js' %}"></script>

src/reactpy_django/templatetags/reactpy.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def pyscript_setup(
241241
return {
242242
"pyscript_config": extend_pyscript_config(extra_py, extra_js, config),
243243
"pyscript_layout_handler": PYSCRIPT_LAYOUT_HANDLER,
244-
"debug": django_settings.DEBUG,
244+
"django_debug": django_settings.DEBUG,
245245
}
246246

247247

@@ -250,7 +250,7 @@ def failure_context(dotted_path: str, error: Exception):
250250

251251
return {
252252
"reactpy_failure": True,
253-
"debug": django_settings.DEBUG,
253+
"django_debug": django_settings.DEBUG,
254254
"reactpy_dotted_path": dotted_path,
255255
"reactpy_error": type(error).__name__,
256256
}

tests/test_app/settings_multi_db.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@
127127
]
128128

129129
# Logging
130-
LOG_LEVEL = "WARNING"
131-
if DEBUG and ("test" not in sys.argv):
132-
LOG_LEVEL = "DEBUG"
130+
LOG_LEVEL = "DEBUG"
133131
LOGGING = {
134132
"version": 1,
135133
"disable_existing_loggers": False,

tests/test_app/settings_single_db.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@
115115
]
116116

117117
# Logging
118-
LOG_LEVEL = "WARNING"
119-
if DEBUG and ("test" not in sys.argv):
120-
LOG_LEVEL = "DEBUG"
118+
LOG_LEVEL = "DEBUG"
121119
LOGGING = {
122120
"version": 1,
123121
"disable_existing_loggers": False,

0 commit comments

Comments
 (0)