From 53205acabdafc350536bf301833ea19d9e0217c5 Mon Sep 17 00:00:00 2001 From: benjaoming Date: Thu, 7 Feb 2013 15:27:20 +0100 Subject: [PATCH] fix setting article fk on reusable plugins for identifying permissions --- wiki/conf/settings.py | 2 +- wiki/models/pluginbase.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wiki/conf/settings.py b/wiki/conf/settings.py index ea081a40..4ffc2949 100644 --- a/wiki/conf/settings.py +++ b/wiki/conf/settings.py @@ -13,7 +13,7 @@ WIKI_LANGUAGE = 'markdown' # extend the built-in editor and customize it.... EDITOR = getattr( django_settings, 'WIKI_EDITOR', 'wiki.editors.markitup.MarkItUp' ) -MARKDOWN_KWARGS = {'extensions': ['footnotes', 'headerid', 'extra', 'toc'], 'safe_mode': 'replace'} +MARKDOWN_KWARGS = {'extensions': ['headerid', 'extra', 'toc'], 'safe_mode': 'replace'} MARKDOWN_KWARGS.update(getattr( django_settings, 'WIKI_MARKDOWN_KWARGS', {} )) # This slug is used in URLPath if an article has been deleted. The children of the diff --git a/wiki/models/pluginbase.py b/wiki/models/pluginbase.py index 78174fd4..7325b04d 100644 --- a/wiki/models/pluginbase.py +++ b/wiki/models/pluginbase.py @@ -97,7 +97,7 @@ class ReusablePlugin(ArticlePlugin): # Automatically make the original article the first one in the added set if not self.article: articles = self.articles.all() - if articles.count() == 0: + if articles.exists(): self.article = articles[0] super(ReusablePlugin, self).save(*args, **kwargs) -- 2.45.2