Skip to content

Commit fe6fe38

Browse files
committed
Attempt 3 at fixing tests
1 parent 3afad19 commit fe6fe38

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

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

3535
### Fixed
3636

37-
- Fixed bug where pre-rendered components could generate a `SynchronousOnlyOperation` exception if they utilize the Django ORM.
37+
- Fixed bug where pre-rendered components could generate a `SynchronousOnlyOperation` exception if they access a freshly logged out Django user object.
3838

3939
## [5.1.1] - 2024-12-02
4040

src/reactpy_django/templatetags/reactpy.py

+4
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ def component(
144144
)
145145
_logger.error(msg)
146146
return failure_context(dotted_path, ComponentCarrierError(msg))
147+
148+
# Call `dir` before prerendering to make sure the user object is loaded
149+
dir(request.user)
150+
147151
_prerender_html = prerender_component(user_component, args, kwargs, uuid, request)
148152

149153
# Fetch the offline component's HTML, if requested

0 commit comments

Comments
 (0)