Skip to content

Commit

Permalink
Merge pull request #4986 from yakky/feature/fix_cache_settings
Browse files Browse the repository at this point in the history
Fix cache settings
  • Loading branch information
yakky committed Feb 10, 2016
2 parents dee09df + 40902a7 commit 4414c66
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,10 @@ Please see Install/2.4 release notes *before* attempting to upgrade to version 2
- Fix JS error when using PageSelectWidget
- Fix whitespace markup issues in draft mode
- Detect plugin migrations layout in tests


=== 3.0.17 (unreleased) ===

- Fix ExtensionToolbar when language is removed but titles still exists…
- Fix PageSelectWidget JS syntax
- Fix cache settings
6 changes: 3 additions & 3 deletions cms/test_utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ def configure(db_url, **extra):
CMS_PERMISSION=True,
CMS_PUBLIC_FOR='all',
CMS_CACHE_DURATIONS={
'menus': 0,
'content': 0,
'permissions': 0,
'menus': 60,
'content': 60,
'permissions': 60,
},
CMS_APPHOOKS=[],
CMS_PLUGIN_PROCESSORS=tuple(),
Expand Down
12 changes: 7 additions & 5 deletions cms/utils/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def wrapper():
# Whether to use raw ID lookups for users when PERMISSION is True
'RAW_ID_USERS': False,
'PUBLIC_FOR': 'all',
'CONTENT_CACHE_DURATION': 60,
'APPHOOKS': [],
'TOOLBARS': [],
'SITE_CHOICES_CACHE_KEY': 'CMS:site_choices',
Expand All @@ -67,11 +66,14 @@ def wrapper():


def get_cache_durations():
return {
'menus': getattr(settings, 'MENU_CACHE_DURATION', 60 * 60),
'content': get_cms_setting('CONTENT_CACHE_DURATION'),
"""
Returns the setting: CMS_CACHE_DURATIONS or the defaults.
"""
return getattr(settings, 'CMS_CACHE_DURATIONS', {
'menus': 60 * 60,
'content': 60,
'permissions': 60 * 60,
}
})


@default('CMS_MEDIA_ROOT')
Expand Down
2 changes: 1 addition & 1 deletion test_requirements/requirements_base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docopt==0.6.2
unittest-xml-reporting==1.9.0
sphinx
Pillow==2.5.3
django-classy-tags>=0.5
django-classy-tags>=0.5,<0.7.1
html5lib>=0.90,<0.9999
django-mptt>=0.6,<0.7
django-sekizai>=0.7
Expand Down

0 comments on commit 4414c66

Please sign in to comment.