Commit be01710d authored by Leon Tappe's avatar Leon Tappe 🔥
Browse files

add motd route for verification app users

parent 412b282f
......@@ -588,7 +588,7 @@ def admin_settings():
db.session.add(setting)
db.session.commit()
new_setting = Setting.query.filter_by(key=setting.key).first()
return jsonify({new_setting.key : new_setting.value})
return jsonify({new_setting.key: new_setting.value})
except:
return 'failed to add setting, check for duplicate key', 400
......@@ -598,13 +598,13 @@ def admin_settings():
def single_setting(key):
if request.method == 'GET':
setting = Setting.query.filter_by(key=key).first()
return jsonify({setting.key : setting.value})
return jsonify({setting.key: setting.value})
if request.method == 'PUT':
if db.session.query(Setting).filter(Setting.key == key).update({Setting.value: request.json['value']}) < 1:
return 'not found', 404
db.session.commit()
new_setting = Setting.query.filter_by(key=key).first()
return jsonify({new_setting.key : new_setting.value})
return jsonify({new_setting.key: new_setting.value})
if request.method == 'DELETE':
if db.session.query(Setting).filter(Setting.key == key).delete() < 1:
return 'not found', 404
......@@ -616,3 +616,9 @@ def single_setting(key):
@require_oauth('user')
def user_settings():
return get_settings()
@bp.route('/motd', methods=['GET'])
def motd():
setting = Setting.query.filter_by(key='motd_public').first()
return jsonify({setting.key: setting.value})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment