Skip to content

Commit

Permalink
Grab only custom sqla class from config
Browse files Browse the repository at this point in the history
  • Loading branch information
shosca committed Jun 13, 2018
1 parent 5cd998a commit c4df604
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions django_sorcery/db/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ def get(self, alias=None, cls=SQLAlchemy, **kwargs):
options = {}
with suppress(Exception):
settings = get_settings(alias)
options = settings.get("OPTIONS", {})
cls = import_string(settings.get("SQLALCHEMY"))

options.update(kwargs)
assert SQLAlchemy in cls.mro(), "'%s' needs to subclass from SQLAlchemy" % cls.__name__

return self.setdefault(alias, cls(alias=alias, **options))
return self.setdefault(alias, cls(alias=alias))

def update(self, *args, **kwargs):
for arg in args:
Expand Down

0 comments on commit c4df604

Please sign in to comment.