From 8845c0be88bf68fa0e42d05c7196cd52d897623b Mon Sep 17 00:00:00 2001 From: Pierre Dulac Date: Sun, 3 Mar 2013 01:09:39 +0100 Subject: Fix import errors --- rest_framework/compat.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'rest_framework/compat.py') diff --git a/rest_framework/compat.py b/rest_framework/compat.py index e0a43f3f..1e04e8f6 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -431,5 +431,12 @@ except ImportError: # OAuth 2 support is optional try: import provider.oauth2 as oauth2_provider + + # Hack to fix submodule import issues + submodules = ['backends', 'forms','managers','models','urls','views'] + for s in submodules: + mod = __import__('provider.oauth2.%s.*' % s) + setattr(oauth2_provider, s, mod) + except ImportError: oauth2_provider = None -- cgit v1.2.3