From 60ba8d479993086d183521f6e645dfd98cc961a3 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 28 Nov 2021 22:24:49 +0100 Subject: [PATCH] fix(core) Fix entry point name --- flaschengeist/app.py | 4 ++-- flaschengeist/controller/roleController.py | 2 +- flaschengeist/models/__init__.py | 2 +- setup.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flaschengeist/app.py b/flaschengeist/app.py index fbbdf60..b886f78 100644 --- a/flaschengeist/app.py +++ b/flaschengeist/app.py @@ -38,7 +38,7 @@ class CustomJSONEncoder(JSONEncoder): def __load_plugins(app): logger.info("Search for plugins") app.config["FG_PLUGINS"] = {} - for entry_point in pkg_resources.iter_entry_points("flaschengeist.plugin"): + for entry_point in pkg_resources.iter_entry_points("flaschengeist.plugins"): logger.debug("Found plugin: >{}<".format(entry_point.name)) plugin = None if entry_point.name in config and config[entry_point.name].get("enabled", False): @@ -111,7 +111,7 @@ def create_app(test_config=None): @app.after_request def after_request(response): header = response.headers - header['Access-Control-Allow-Origin'] = '*' + header["Access-Control-Allow-Origin"] = "*" header["Access-Control-Allow-Methods"] = "GET,HEAD,OPTIONS,POST,PUT" header["Access-Control-Allow-Headers"] = "Origin, X-Requested-With, Content-Type, Accept, Authorization" return response diff --git a/flaschengeist/controller/roleController.py b/flaschengeist/controller/roleController.py index 1e4e6e1..a81c1bb 100644 --- a/flaschengeist/controller/roleController.py +++ b/flaschengeist/controller/roleController.py @@ -11,7 +11,7 @@ def get_all(): return Role.query.all() -def get(role_name): +def get(role_name) -> Role: if type(role_name) is int: role = Role.query.get(role_name) else: diff --git a/flaschengeist/models/__init__.py b/flaschengeist/models/__init__.py index d739b88..f4ab8ec 100644 --- a/flaschengeist/models/__init__.py +++ b/flaschengeist/models/__init__.py @@ -39,7 +39,7 @@ class ModelSerializeMixin: key, value = d.popitem() return value return d - + def __str__(self) -> str: return self.serialize().__str__() diff --git a/setup.py b/setup.py index 6d80097..6bf3a67 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ setup( "test": ["pytest", "coverage"], }, entry_points={ - "flaschengeist.plugin": [ + "flaschengeist.plugins": [ # Authentication providers "auth_plain = flaschengeist.plugins.auth_plain:AuthPlain", "auth_ldap = flaschengeist.plugins.auth_ldap:AuthLDAP [ldap]",