Skip to content

Commit

Permalink
Added ImproperlyConfigured on invalid apphook name or urlconf name
Browse files Browse the repository at this point in the history
  • Loading branch information
samluescher committed Mar 22, 2010
1 parent 4e63a49 commit d67411a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cms/apphook_pool.py
@@ -1,5 +1,6 @@
from django.conf import settings
from cms.exceptions import AppAllreadyRegistered
from django.core.exceptions import ImproperlyConfigured

class ApphookPool(object):
def __init__(self):
Expand Down Expand Up @@ -51,8 +52,9 @@ def get_apphook(self, app_name):
return self.apps[app_name]
except KeyError:
# deprecated: return apphooks registered in db with urlconf name instead of apphook class name
for key, app in self.apps.items():
for app in self.apps.values():
if app_name in app.urls:
return app
raise ImproperlyConfigured('No registered apphook `%s` found.')

apphook_pool = ApphookPool()

0 comments on commit d67411a

Please sign in to comment.