mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-08-11 23:31:51 +00:00
format content (#198)
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from importlib import import_module
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
|
||||
|
||||
def import_class(path):
|
||||
path_bits = path.split(".")
|
||||
@ -14,9 +15,7 @@ def import_class(path):
|
||||
module_itself = import_module(module_path)
|
||||
|
||||
if not hasattr(module_itself, class_name):
|
||||
message = "The Python module '{}' has no '{}' class.".format(
|
||||
module_path, class_name
|
||||
)
|
||||
message = "The Python module '{}' has no '{}' class.".format(module_path, class_name)
|
||||
raise ImportError(message)
|
||||
|
||||
return getattr(module_itself, class_name)
|
||||
|
Reference in New Issue
Block a user