Comments (2)
You're correct, the templatetags aren't being cached properly
As mentioned not using cache_result as a decorator works perfectly:
@register.simple_tag
def avatar_url(user, size=AVATAR_DEFAULT_SIZE):
return cache_result(avatar_url_uncached)(user, size)
def avatar_url_uncached(user, size=AVATAR_DEFAULT_SIZE):
avatar = get_primary_avatar(user, size=size)
etc
This affects all templatetags as far as I've examined, the 'avatar' templatetag wasn't being cached in my case. Perhaps func.name in cached_result() changes when it is used as a decorator, but this is just a hunch.
from django-avatar.
Fixed as of 2662402
from django-avatar.
Related Issues (20)
- Fix RemovedInDjango40Warning warnings to support Django 4.0 HOT 3
- Migration to Django4.0 : TypeError: __init__() got an unexpected keyword argument 'providing_args' HOT 4
- Resized avatar getting double rotation in Safari HOT 4
- Cut a release/move to jazzband HOT 3
- Implement Jazzband guidelines for django-avatar HOT 21
- update readme links
- ANTIALIAS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead. HOT 1
- update links
- version in multiple places
- AVATAR_GRAVATAR_FIELD is optional and code fails when not given
- Avatar initial set-up; ReadMe Specificity
- get_primary_avatar() fails when given an int
- Add support for STORAGES settings introduced in Django 4.2 HOT 1
- BUG Custom User Model in Django E039 HOT 1
- Error: Reverse for 'avatar_change' not found HOT 4
- django-avatar readthedocs are not updated
- ResourceWarning: unclosed file in create_thumbnail
- RemovedInDjango51Warning: The DEFAULT_FILE_STORAGE setting is deprecated HOT 7
- Initials Avatar
- Serialize avatars list along with User model
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-avatar.