From 82cc74e41f613d2be4016fbc329ffbeec9c4b118 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 20 Aug 2024 12:06:44 +0200 Subject: [PATCH] Return klass in register function So it can be used as a decorator @register class MyAutoComplete: pass --- agnocomplete/register.py | 1 + 1 file changed, 1 insertion(+) diff --git a/agnocomplete/register.py b/agnocomplete/register.py index 702deff..91ac0d0 100644 --- a/agnocomplete/register.py +++ b/agnocomplete/register.py @@ -11,6 +11,7 @@ def register(klass): "Register a class into the agnocomplete registry." logger.info("registering {}".format(klass.__name__)) AGNOCOMPLETE_REGISTRY[klass.slug] = klass + return klass def get_agnocomplete_registry():