Files
deb-python-django-formtools/formtools/wizard/storage/__init__.py
Claude Paroz 792e42c1ef Fixed #17061 -- Factored out importing object from a dotted path
Thanks Carl Meyer for the report.
2013-02-04 16:38:25 +01:00

15 lines
529 B
Python

from django.core.exceptions import ImproperlyConfigured
from django.utils.module_loading import import_by_path
from django.contrib.formtools.wizard.storage.base import BaseStorage
from django.contrib.formtools.wizard.storage.exceptions import (
MissingStorage, NoFileStorageConfigured)
def get_storage(path, *args, **kwargs):
try:
storage_class = import_by_path(path)
except ImproperlyConfigured as e:
raise MissingStorage('Error loading storage: %s' % e)
return storage_class(*args, **kwargs)