fix(core) Fix entry point name

This commit is contained in:
Ferdinand Thiessen 2021-11-28 22:24:49 +01:00
parent 50632eb333
commit 1011360694
4 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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:

View File

@ -39,7 +39,7 @@ class ModelSerializeMixin:
key, value = d.popitem()
return value
return d
def __str__(self) -> str:
return self.serialize().__str__()

View File

@ -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]",
@ -66,7 +66,6 @@ setup(
"users = flaschengeist.plugins.users:UsersPlugin",
"roles = flaschengeist.plugins.roles:RolesPlugin",
"balance = flaschengeist.plugins.balance:BalancePlugin",
"events = flaschengeist.plugins.events:EventPlugin",
"mail = flaschengeist.plugins.message_mail:MailMessagePlugin",
"pricelist = flaschengeist.plugins.pricelist:PriceListPlugin",
],