forked from CGM_Public/pretix_original
EventPluginSignal: Fixed a problem with plugins that live in a top-level package
This commit is contained in:
@@ -32,12 +32,14 @@ class EventPluginSignal(django.dispatch.Signal):
|
|||||||
searchpath = receiver.__module__
|
searchpath = receiver.__module__
|
||||||
app = None
|
app = None
|
||||||
mod = None
|
mod = None
|
||||||
while "." in searchpath:
|
while True:
|
||||||
try:
|
try:
|
||||||
if apps.is_installed(searchpath):
|
if apps.is_installed(searchpath):
|
||||||
app = apps.get_app_config(searchpath.split(".")[-1])
|
app = apps.get_app_config(searchpath.split(".")[-1])
|
||||||
except LookupError:
|
except LookupError:
|
||||||
pass
|
pass
|
||||||
|
if "." not in searchpath:
|
||||||
|
break
|
||||||
searchpath, mod = searchpath.rsplit(".", 1)
|
searchpath, mod = searchpath.rsplit(".", 1)
|
||||||
|
|
||||||
# Only fire receivers from active plugins and core modules
|
# Only fire receivers from active plugins and core modules
|
||||||
|
|||||||
Reference in New Issue
Block a user