Update Profile caching to use get_object_cached_field.

Review Request #14328 — Created Feb. 4, 2025 and submitted — Latest diff uploaded

Information

Review Board
release-7.1.x

Reviewers

Djblets received a new function for fetching related objects from a
select_related() or prefetch_related() cache, which can simplify a
lot of code. One of the core tests for this was converting our somewhat
complex User.get_profile() cache logic to use that.

This change moves this method over to that, simplifying the function a
bit and helping ensure that functionality continues to work as expected.

Unit tests pass.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
Update Profile caching to use get_object_cached_field.
Djblets received a new function for fetching related objects from a `select_related()` or `prefetch_related()` cache, which can simplify a lot of code. One of the core tests for this was converting our somewhat complex `User.get_profile()` cache logic to use that. This change moves this method over to that, simplifying the function a bit and helping ensure that functionality continues to work as expected.
3c0e7a296e08331311e9b785e159cbe9eec7a832 Christian Hammond
reviewboard/accounts/models.py
Loading...