pub1c-web/app/api/module.py

22 lines
502 B
Python
Raw Normal View History

2021-10-07 10:59:51 +00:00
from flask_restful import Resource, abort
from app.glob import get_manager
class EnterpriseModule(Resource):
def get(self):
manager = get_manager()
if not manager.has_module():
abort(404, message='not found')
return {
'message': 'found'
}
def put(self):
manager = get_manager()
if manager.has_module():
return '', 304
manager.add_module()
return {
'message': 'success'
}