[plugin] Plugins should have an unique ID
This commit is contained in:
parent
2dabd1dd34
commit
3d833fb6af
|
@ -33,6 +33,7 @@ class Plugin:
|
|||
|
||||
blueprint = None # You have to override
|
||||
permissions = [] # You have to override
|
||||
id = "dev.flaschengeist.plugin" # You have to override
|
||||
name = "plugin" # You have to override
|
||||
models = None # You have to override
|
||||
|
||||
|
@ -94,7 +95,7 @@ class Plugin:
|
|||
db.session.commit()
|
||||
|
||||
def notify(self, user, text: str, data=None):
|
||||
n = Notification(text=text, data=data, plugin=self.name, user_=user)
|
||||
n = Notification(text=text, data=data, plugin=self.id, user_=user)
|
||||
db.session.add(n)
|
||||
db.session.commit()
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ from . import permissions, models
|
|||
|
||||
class EventPlugin(Plugin):
|
||||
name = "events"
|
||||
id = "dev.flaschengeist.events"
|
||||
plugin = LocalProxy(lambda: current_app.config["FG_PLUGINS"][EventPlugin.name])
|
||||
permissions = permissions.permissions
|
||||
blueprint = Blueprint(name, __name__)
|
||||
|
|
Loading…
Reference in New Issue