Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into next
Browse files Browse the repository at this point in the history
* master:
  Last patch re feincms#323 was a sledgehammer to crack a walnut. This is a better solution.
  • Loading branch information
matthiask committed Jan 10, 2013
2 parents dea625f + 3705cc7 commit e73a557
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions feincms/__init__.py
Expand Up @@ -23,7 +23,7 @@ def __getattr__(self, attr):


COMPLETELY_LOADED = False
def ensure_completely_loaded(force=False):
def ensure_completely_loaded():
"""
This method ensures all models are completely loaded
Expand All @@ -36,7 +36,7 @@ def ensure_completely_loaded(force=False):
"""

global COMPLETELY_LOADED
if COMPLETELY_LOADED and not force:
if COMPLETELY_LOADED:
return True

# Ensure meta information concerning related fields is up-to-date.
Expand Down
5 changes: 4 additions & 1 deletion feincms/models.py
Expand Up @@ -706,7 +706,10 @@ class Meta(feincms_content_base.Meta):
cls.feincms_item_editor_includes.setdefault(
key, set()).update(incls)

ensure_completely_loaded(force=True)
# since this content type is potentially being added after cls is
# loaded by Django, we will reload the cls's related objects cache.
# See issue #323.
cls._meta._fill_related_objects_cache()
return new_type

@property
Expand Down

0 comments on commit e73a557

Please sign in to comment.