When debug is off, swallow AlreadyRegisteredException
This commit is contained in:
parent
17cb8fdf72
commit
344064dd7c
1 changed files with 10 additions and 5 deletions
|
@ -2,13 +2,14 @@
|
||||||
from __future__ import absolute_import, print_function, unicode_literals
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
from cms.utils.permissions import get_current_user
|
from cms.utils.permissions import get_current_user
|
||||||
|
from django import forms
|
||||||
|
from django.conf import settings
|
||||||
|
from django.utils.text import slugify
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from cms.wizards.wizard_base import Wizard
|
from cms.wizards.wizard_base import Wizard
|
||||||
from cms.wizards.wizard_pool import wizard_pool
|
from cms.wizards.wizard_pool import wizard_pool, AlreadyRegisteredException
|
||||||
from django import forms
|
|
||||||
from django.utils.text import slugify
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
from parler.forms import TranslatableModelForm
|
from parler.forms import TranslatableModelForm
|
||||||
|
|
||||||
from .cms_appconfig import BlogConfig
|
from .cms_appconfig import BlogConfig
|
||||||
|
@ -56,7 +57,11 @@ try:
|
||||||
model=Post,
|
model=Post,
|
||||||
description=_('Create a new {0} in {1}').format(config.object_name, config.app_title),
|
description=_('Create a new {0} in {1}').format(config.object_name, config.app_title),
|
||||||
)
|
)
|
||||||
wizard_pool.register(post_wizard)
|
try:
|
||||||
|
wizard_pool.register(post_wizard)
|
||||||
|
except AlreadyRegisteredException:
|
||||||
|
if settings.DEBUG:
|
||||||
|
raise
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# For django CMS version not supporting wizards just ignore this file
|
# For django CMS version not supporting wizards just ignore this file
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Add table
Reference in a new issue