diff options
| author | Johan Berggren <jbn@nordu.net> | 2012-05-14 15:56:57 +0200 |
|---|---|---|
| committer | Johan Berggren <jbn@nordu.net> | 2012-05-14 15:56:57 +0200 |
| commit | 59b22883948f01152da795bf802aa0d60ec9a12e (patch) | |
| tree | 582ca2418f28ed03b2f6f6ae092812d64658d702 /coip/apps/consumer/__init__.py | |
| parent | 080b0e4e0b8efb77da251d40008002bad89713af (diff) | |
Fix in autodiscover for consumer app. Updated settings for Django 1.4.
Some small fixes in consumer.models
Diffstat (limited to 'coip/apps/consumer/__init__.py')
| -rw-r--r-- | coip/apps/consumer/__init__.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/coip/apps/consumer/__init__.py b/coip/apps/consumer/__init__.py index fd6cc15..5cfd0b1 100644 --- a/coip/apps/consumer/__init__.py +++ b/coip/apps/consumer/__init__.py @@ -1,4 +1,3 @@ - __author__ = 'leifj' from django.conf import settings @@ -8,9 +7,14 @@ _consumer_provider_modules = list() def autodiscover(): for app in settings.INSTALLED_APPS: - mod = import_module("%.models" % app) - if hasattr(mod,'consumer_providers' and hasattr(mod.consumer_providers,'__call__')): - _consumer_provider_modules.append(mod) + try: + mod = import_module("%s.models" % app) + except: continue + try: + if hasattr(mod,'consumer_providers') and hasattr(mod.consumer_providers,'__call__'): + _consumer_provider_modules.append(mod) + except AttributeError: + continue def consumer_providers(): p = list() |
