Browse files

fix import that updates pages

  • Loading branch information...
1 parent 975b719 commit d775dcbab9f66ff80ad27ab610365229f8d64e66 @wardi wardi committed Apr 12, 2012
Showing with 4 additions and 2 deletions.
  1. +1 −1 pages/admin/actions.py
  2. +3 −1 pages/managers.py
View
2 pages/admin/actions.py
@@ -68,7 +68,7 @@ def validate_pages_json_data(d, preferred_lang):
seen_complete_slugs = dict(
(lang[0], set()) for lang in settings.PAGE_LANGUAGES)
- valid_templates = set(settings.get_page_templates())
+ valid_templates = set(t[0] for t in settings.get_page_templates())
valid_templates.add(global_settings.PAGE_DEFAULT_TEMPLATE)
if d[JSON_PAGE_EXPORT_NAME] != JSON_PAGE_EXPORT_VERSION:
View
4 pages/managers.py
@@ -149,8 +149,10 @@ def create_and_update_from_json_data(self, d, user):
parent_required = True
created = False
+ languages = set(lang[0] for lang in settings.PAGE_LANGUAGES)
+
for lang, s in d['complete_slug'].items():
- if lang not in settings.PAGE_LANGUAGES:
+ if lang not in languages:
continue
page = self.from_path(s, lang, exclude_drafts=False)

0 comments on commit d775dcb

Please sign in to comment.