Skip to content

Commit

Permalink
uvodni verze samoinstalacniho skriptu #166, pripravuje sklad pro impo…
Browse files Browse the repository at this point in the history
…rt dat z externich zdroju
  • Loading branch information
roman-dvorak committed Nov 4, 2021
1 parent bad4b29 commit 5f59903
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/OpenIntranet/plugins/store/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from .. import BaseHandler


plugin_version = 1

def get_plugin_handlers():
return handlers() + handlers_2() + handlers_3()

Expand All @@ -22,3 +24,21 @@ def get_plugin_info():
],
"role": ["sudo", "sudo-store", "store-manager", "store-user"]
}

def plugin_init(db):
actual_data = db.intranet_plugins.find_one({'_id': 'store'})

if not actual_data: # Prvni spusteni pluginu...
print("Plugin 'store' byl spuštěn poprvé. Pokusím se ho nainstalovat.. ")

structure = {
'_id': 'store',
'version': plugin_version,
'data': { 'data_import': {}}
}
db.intranet_plugins.insert_one(structure)

else:
actual_version = actual_data['version']


0 comments on commit 5f59903

Please sign in to comment.