Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demoting wizard AlreadyRegisteredException to warning #5060

Closed
yakky opened this issue Mar 4, 2016 · 14 comments
Closed

Demoting wizard AlreadyRegisteredException to warning #5060

yakky opened this issue Mar 4, 2016 · 14 comments

Comments

@yakky
Copy link
Member

yakky commented Mar 4, 2016

How about demoting AlreadyRegisteredException (https://github.com/divio/django-cms/blob/release/3.2.x/cms/wizards/wizard_pool.py#L78) to a simple warning?
As this is raised on every page in edit mode, user has little / no way to recover from the situation: the CMS can just skip the duplicate wizard, the error itself it's not that grave to return a full exception

@yakky yakky added this to the 3.2.x milestone Mar 4, 2016
@bxm156
Copy link

bxm156 commented Mar 4, 2016

+1 When I encountered this, it prevented me from doing anything in Edit Mode

@yakky
Copy link
Member Author

yakky commented Mar 6, 2016

Ping @divio/django-cms-core for opinions

@czpython
Copy link
Contributor

czpython commented Mar 6, 2016

@yakky While I agree that the error is not urgent, I think the current behavior is correct and in alignment with the way django's admin and cms plugins handle such a scenario.

As far as I understand it, a duplicate wizard can only happen due to a programming error and so it should fail on startup (just like the admin).

@bxm156
Copy link

bxm156 commented Mar 6, 2016

I encountered this error randomly, without knowing how it happened,
probably just by using the UI. As a user, I was locked out of the Admin
interface. I was forced to delete my database and start over new, not a
great experience.
On Mar 6, 2016 8:07 AM, "Paulo" notifications@github.com wrote:

@yakky https://github.com/yakky While I agree that the error is not
urgent, I think the current behavior is correct and in alignment with the
way django's admin and cms plugins handle such a scenario.

As far as I understand it, a duplicate wizard can only happen due to a
programming error and so it should fail on startup (just like the admin).


Reply to this email directly or view it on GitHub
#5060 (comment).

@mkoistinen
Copy link
Contributor

@bxm156 sounds like we need to track this down then. Did you happen to preserve the resulting stack trace? If not, but it happens again, we'd really like to see that.

@bxm156
Copy link

bxm156 commented Mar 6, 2016

I should have it in my cloud watch logs. I'll pull it up and post it here
On Mar 6, 2016 12:45 PM, "Martin Koistinen" notifications@github.com
wrote:

@bxm156 https://github.com/bxm156 sounds like we need to track this
down then. Did you happen to preserve the resulting stack trace? If not,
but it happens again, we'd really like to see that.


Reply to this email directly or view it on GitHub
#5060 (comment).

@bxm156
Copy link

bxm156 commented Mar 6, 2016

Traceback (most recent call last): 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 174, in get_response response = self.process_exception_by_middleware(e, request) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 172, in get_response response = response.render() 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/response.py", line 160, in render self.content = self.rendered_content 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/response.py", line 137, in rendered_content content = template.render(context, self._request) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/backends/django.py", line 95, in render return self.template.render(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/base.py", line 206, in render return self._render(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/base.py", line 197, in _render return self.nodelist.render(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/base.py", line 992, in render bit = node.render_annotated(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/base.py", line 959, in render_annotated return self.render(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 173, in render return compiled_parent._render(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/base.py", line 197, in _render return self.nodelist.render(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/base.py", line 992, in render bit = node.render_annotated(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/base.py", line 959, in render_annotated return self.render(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 173, in render return compiled_parent._render(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/base.py", line 197, in _render return self.nodelist.render(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/base.py", line 992, in render bit = node.render_annotated(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/base.py", line 959, in render_annotated return self.render(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/classytags/core.py", line 138, in render return self.render_tag(context, **kwargs) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/sekizai/templatetags/sekizai_tags.py", line 83, in render_tag rendered_contents = nodelist.render(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/base.py", line 992, in render bit = node.render_annotated(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/django/template/base.py", line 959, in render_annotated return self.render(context) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/classytags/core.py", line 138, in render return self.render_tag(context, **kwargs) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/cms/templatetags/cms_tags.py", line 687, in render_tag request.toolbar.post_template_populate() 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/cms/toolbar/toolbar.py", line 313, in post_template_populate self._call_toolbar('post_template_populate') 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/cms/toolbar/toolbar.py", line 351, in _call_toolbar result = getattr(toolbar, func_name)() 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/cms/cms_toolbars.py", line 73, in post_template_populate self.add_wizard_button() 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/cms/cms_toolbars.py", line 109, in add_wizard_button list(entry_choices(user, self.page))) == 0 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/cms/wizards/wizard_pool.py", line 19, in entry_choices for entry in wizard_pool.get_entries(): 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/cms/wizards/wizard_pool.py", line 117, in get_entries self._discover() 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/cms/wizards/wizard_pool.py", line 35, in _discover load('cms_wizards') 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/cms/utils/django_load.py", line 61, in load get_module(app, modname, verbose, failfast) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/cms/utils/django_load.py", line 45, in get_module module = import_module(module_name) 
 File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/djangocms_blog/cms_wizards.py", line 53, in <module> wizard_pool.register(post_wizard) 
 File "/home/site/.env/site/local/lib/python2.7/site-packages/cms/wizards/wizard_pool.py", line 80, in register model.__name__) AlreadyRegisteredException: A wizard has already been registered for model: Post

@yakky
Copy link
Member Author

yakky commented Mar 7, 2016

@mkoistinen for some reason I can't reproduce, the blog wizard registration is called more than once (see nephila/djangocms-blog#217).
Blog wizard handles the multiple apphooks registration by creating multiple wizard classes dynamically, it's tested in production environment to behave correctly

@czpython czpython modified the milestones: Clean up issues & pull requests, 3.2.x Jan 24, 2017
@czpython
Copy link
Contributor

Hello @bxm156,
Have you been able to reproduce this on a newer version (>= 3.4.x)?

@plamen-nikolov
Copy link

Yes, I just managed to reproduce it.

Django-CMS 3.4.5

@czpython
Copy link
Contributor

@plamen-nikolov would you be able to provide us with instructions or playground project where this is reproducible?

@czpython
Copy link
Contributor

Ping @plamen-nikolov

@stale
Copy link

stale bot commented Jun 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 30, 2022
@stale
Copy link

stale bot commented Jul 28, 2022

This will now be closed due to inactivity, but feel free to reopen it.

@stale stale bot closed this as completed Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants