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

Fixing #1649 - NoReverseMatch raised if apphook doesn't exist #2156

Closed
wants to merge 1 commit into from

Conversation

JakeHedman
Copy link
Contributor

Some apps, like cmsplugin-zinnia and cmsplugin_news will raise NoReverseMatch when trying to generate their menus before an apphook is installed. In sampleapp this is solved by adding a try-except like the one in this commit. Placing the try-except in django-cms instead of inside every app would simplify the process of writing plugins and avoid some confusing 500-errors for new users trying to install plugins.

Some apps, like cmsplugin-zinnia and cmsplugin_news will raise NoReverseMatch when trying to generate their menus before an apphook is installed. In sampleapp this is solved by adding a try-except like the one in this commit. Placing the try-except in django-cms instead of inside every app would simplify the process of writing plugins and avoid some confusing 500-errors for new users trying to install plugins.
@digi604
Copy link
Contributor

digi604 commented Aug 8, 2013

looks good to me

@yakky
Copy link
Member

yakky commented Aug 16, 2013

Probably some kind of user feedback should be added here, swallowing exceptions is really nasty...
As messages framework is now required, it should be possible to use it in such cases

except NoReverseMatch:
# Apps might raise NoReverseMatch if an apphook does not yet
# exist, skip them instead of crashing
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use nodes = [] instead of pass. nodes variable must be inizialized

@yakky
Copy link
Member

yakky commented Sep 19, 2013

#2156 adds a message feedback for the users (only visibile in the admin and when in draft mode)

digi604 added a commit that referenced this pull request Nov 25, 2013
@sisihagen
Copy link

I has same problem when i want call the website of blog.

NoReverseMatch at /de/admin/r/46/2/
u'aldryn_blog' is not a registered namespace

I has try to fix with that what is post here but the menu_pool.py is other as here stand.

Django 1.6.4
django-cms (3.0)
aldryn-blog (0.3.9)

Has someone an idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants