Skip to content

Commit

Permalink
v1.1.2 - fix AppRegistryNotReady error with django
Browse files Browse the repository at this point in the history
  • Loading branch information
Someguy123 committed Jul 8, 2019
1 parent bbe367f commit aa75feb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions privex/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,24 @@ class ImproperlyConfigured(Exception):
"""Placeholder in-case this fails to import from django.core.exceptions"""
pass

class AppRegistryNotReady(Exception):
"""Placeholder in-case this fails to import from django.core.exceptions"""
pass

# Only import the Django functions if Django is actually installed
try:
import django
from django.core.exceptions import ImproperlyConfigured
from django.core.exceptions import ImproperlyConfigured, AppRegistryNotReady
from privex.helpers.django import *
except ImportError:
log.debug('privex.helpers __init__ failed to import "django", not loading django helpers')
pass
except ImproperlyConfigured:
except (ImproperlyConfigured, AppRegistryNotReady):
log.debug('privex.helpers __init__ failed to import "django", not loading django helpers')
pass
except Exception:
log.debug('privex.helpers __init__ failed to import "django", (unknown exception) not loading django helpers')
pass


from privex.helpers.common import *
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
setup(
name='privex_helpers',

version='1.1.1',
version='1.1.2',

description='A variety of helper functions and classes, useful for many different projects',
long_description=long_description,
Expand Down

0 comments on commit aa75feb

Please sign in to comment.