8000 fix: allow partially overriding CMS_CACHE_DURATIONS by eagleoflqj · Pull Request #7339 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

fix: allow partially overriding CMS_CACHE_DURATIONS #7339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 8, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Allow partially overriding CMS_CACHE_DURATIONS
  • Loading branch information
eagleoflqj committed Jun 15, 2022
commit f9c2c973af9c75c51bb9924e7b2d0a74ce97c39e
6 changes: 4 additions & 2 deletions cms/utils/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ def get_cache_durations():
"""
Returns the setting: CMS_CACHE_DURATIONS or the defaults.
"""
return getattr(settings, 'CMS_CACHE_DURATIONS', {
cache_durations = {
'menus': 60 * 60,
'content': 60,
'permissions': 60 * 60,
})
}
cache_durations.update(getattr(settings, 'CMS_CACHE_DURATIONS', {}))
return cache_durations


@default('CMS_MEDIA_ROOT')
Expand Down
0