2020-01-18 22:31:49 +00:00
|
|
|
from flask import Blueprint, request, jsonify
|
2020-05-22 19:55:14 +00:00
|
|
|
from datetime import datetime, time, date
|
|
|
|
import geruecht.controller.mainController as mc
|
2020-03-04 20:11:41 +00:00
|
|
|
import geruecht.controller.ldapController as lc
|
2020-01-19 08:07:45 +00:00
|
|
|
from geruecht.decorator import login_required
|
2020-03-04 20:11:41 +00:00
|
|
|
from geruecht.model import MONEY, GASTRO, VORSTAND
|
2020-03-10 08:19:11 +00:00
|
|
|
from geruecht.logger import getDebugLogger, getJobsLogger
|
|
|
|
|
|
|
|
debug = getDebugLogger()
|
|
|
|
jobL = getJobsLogger()
|
2020-01-18 22:31:49 +00:00
|
|
|
|
|
|
|
vorstand = Blueprint("vorstand", __name__)
|
2020-05-22 19:55:14 +00:00
|
|
|
mainController = mc.MainController()
|
2020-03-10 10:08:24 +00:00
|
|
|
ldap = lc.LDAPController()
|
|
|
|
|
2020-01-19 08:07:45 +00:00
|
|
|
|
2020-03-03 21:33:47 +00:00
|
|
|
@vorstand.route('/um/setStatus', methods=['POST'])
|
2020-03-04 20:11:41 +00:00
|
|
|
@login_required(groups=[MONEY, GASTRO, VORSTAND])
|
2020-03-03 21:33:47 +00:00
|
|
|
def _setStatus(**kwargs):
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.info("/um/setStatus")
|
2020-03-03 21:33:47 +00:00
|
|
|
try:
|
|
|
|
data = request.get_json()
|
|
|
|
name = data['name']
|
2020-05-22 19:55:14 +00:00
|
|
|
retVal = mainController.setStatus(name)
|
2020-03-10 10:08:24 +00:00
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
2020-03-03 21:33:47 +00:00
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.debug("exception", exc_info=True)
|
2020-03-03 21:33:47 +00:00
|
|
|
return jsonify({"error": str(err)}), 500
|
|
|
|
|
2020-03-10 10:08:24 +00:00
|
|
|
|
2020-03-03 21:33:47 +00:00
|
|
|
@vorstand.route('/um/updateStatus', methods=['POST'])
|
2020-03-04 20:11:41 +00:00
|
|
|
@login_required(groups=[MONEY, GASTRO, VORSTAND])
|
2020-03-03 21:33:47 +00:00
|
|
|
def _updateStatus(**kwargs):
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.info("/um/updateStatus")
|
2020-03-03 21:33:47 +00:00
|
|
|
try:
|
|
|
|
data = request.get_json()
|
2020-05-22 19:55:14 +00:00
|
|
|
retVal = mainController.updateStatus(data)
|
2020-03-10 10:08:24 +00:00
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
2020-03-03 21:33:47 +00:00
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.debug("exception", exc_info=True)
|
2020-03-03 21:33:47 +00:00
|
|
|
return jsonify({"error": str(err)}), 500
|
|
|
|
|
2020-03-10 10:08:24 +00:00
|
|
|
|
2020-03-03 21:33:47 +00:00
|
|
|
@vorstand.route('/um/deleteStatus', methods=['POST'])
|
2020-03-04 20:11:41 +00:00
|
|
|
@login_required(groups=[MONEY, GASTRO, VORSTAND])
|
2020-03-03 21:33:47 +00:00
|
|
|
def _deleteStatus(**kwargs):
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.info("/um/deleteStatus")
|
2020-03-03 21:33:47 +00:00
|
|
|
try:
|
|
|
|
data = request.get_json()
|
2020-05-22 19:55:14 +00:00
|
|
|
mainController.deleteStatus(data)
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.debug("return ok")
|
2020-03-03 21:33:47 +00:00
|
|
|
return jsonify({"ok": "ok"})
|
|
|
|
except Exception as err:
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.debug("exception", exc_info=True)
|
2020-03-03 21:33:47 +00:00
|
|
|
return jsonify({"error": str(err)}), 409
|
|
|
|
|
2020-03-10 10:08:24 +00:00
|
|
|
|
2020-03-03 21:33:47 +00:00
|
|
|
@vorstand.route('/um/updateStatusUser', methods=['POST'])
|
2020-03-04 20:11:41 +00:00
|
|
|
@login_required(groups=[MONEY, GASTRO, VORSTAND])
|
2020-03-03 21:33:47 +00:00
|
|
|
def _updateStatusUser(**kwargs):
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.info("/um/updateStatusUser")
|
2020-03-03 21:33:47 +00:00
|
|
|
try:
|
|
|
|
data = request.get_json()
|
|
|
|
username = data['username']
|
|
|
|
status = data['status']
|
2020-05-22 19:55:14 +00:00
|
|
|
retVal = mainController.updateStatusOfUser(username, status).toJSON()
|
2020-03-10 10:08:24 +00:00
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
2020-03-03 21:33:47 +00:00
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.debug("exception", exc_info=True)
|
2020-03-03 21:33:47 +00:00
|
|
|
return jsonify({"error": str(err)}), 500
|
|
|
|
|
2020-03-10 10:08:24 +00:00
|
|
|
|
2020-03-03 21:33:47 +00:00
|
|
|
@vorstand.route('/um/updateVoting', methods=['POST'])
|
2020-03-04 20:11:41 +00:00
|
|
|
@login_required(groups=[MONEY, GASTRO, VORSTAND])
|
2020-03-03 21:33:47 +00:00
|
|
|
def _updateVoting(**kwargs):
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.info("/um/updateVoting")
|
2020-03-03 21:33:47 +00:00
|
|
|
try:
|
|
|
|
data = request.get_json()
|
|
|
|
username = data['username']
|
|
|
|
voting = data['voting']
|
2020-05-22 19:55:14 +00:00
|
|
|
retVal = mainController.updateVotingOfUser(username, voting).toJSON()
|
2020-03-10 10:08:24 +00:00
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
2020-03-03 21:33:47 +00:00
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.debug("exception", exc_info=True)
|
2020-03-03 21:33:47 +00:00
|
|
|
return jsonify({"error": str(err)}), 500
|
2020-01-18 22:31:49 +00:00
|
|
|
|
2020-05-17 11:35:33 +00:00
|
|
|
@vorstand.route('/um/updateWorkgroups', methods=['POST'])
|
|
|
|
@login_required(groups=[VORSTAND])
|
|
|
|
def _updateWorkgroups(**kwargs):
|
|
|
|
debug.info("/um/updateWorkgroups")
|
|
|
|
try:
|
|
|
|
data = request.get_json()
|
2020-05-22 19:55:14 +00:00
|
|
|
retVal = mainController.updateWorkgroupsOfUser({"id": data['id']}, data['workgroups'])
|
2020-05-17 11:35:33 +00:00
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
|
|
|
return jsonify(retVal), 200
|
|
|
|
except Exception as err:
|
|
|
|
debug.debug("exception", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
2020-03-10 10:08:24 +00:00
|
|
|
|
2020-01-18 22:31:49 +00:00
|
|
|
@vorstand.route("/sm/addUser", methods=['POST', 'GET'])
|
2020-03-04 20:11:41 +00:00
|
|
|
@login_required(groups=[MONEY, GASTRO, VORSTAND])
|
2020-01-19 20:32:58 +00:00
|
|
|
def _addUser(**kwargs):
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.info("/sm/addUser")
|
|
|
|
try:
|
|
|
|
data = request.get_json()
|
|
|
|
user = data['user']
|
|
|
|
day = data['day']
|
|
|
|
month = data['month']
|
|
|
|
year = data['year']
|
2020-03-10 10:08:24 +00:00
|
|
|
date = datetime(year, month, day, 12)
|
2020-05-22 19:55:14 +00:00
|
|
|
job_kind = None
|
|
|
|
if 'job_kind' in data:
|
|
|
|
job_kind = data['job_kind']
|
|
|
|
retVal = mainController.addWorker(user['username'], date, job_kind=job_kind)
|
2020-03-10 10:08:24 +00:00
|
|
|
debug.debug("retrun {{ {} }}".format(retVal))
|
2020-05-22 19:55:14 +00:00
|
|
|
userl = mainController.getUser(user['username'])
|
2020-03-10 10:08:24 +00:00
|
|
|
jobL.info("Vorstand {} {} schreibt Mitglied {} {} am {} zum Dienst ein".format(
|
|
|
|
kwargs['accToken'].user.firstname, kwargs['accToken'].user.lastname, userl.firstname, userl.lastname, date.date()))
|
2020-03-10 08:19:11 +00:00
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
|
|
|
debug.debug("exception", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
2020-01-19 20:32:58 +00:00
|
|
|
|
2020-03-10 10:08:24 +00:00
|
|
|
|
2020-01-19 20:32:58 +00:00
|
|
|
@vorstand.route("/sm/getUser", methods=['POST'])
|
2020-03-04 20:11:41 +00:00
|
|
|
@login_required(groups=[MONEY, GASTRO, VORSTAND])
|
2020-01-19 20:32:58 +00:00
|
|
|
def _getUser(**kwargs):
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.info("/sm/getUser")
|
|
|
|
try:
|
|
|
|
data = request.get_json()
|
|
|
|
day = data['day']
|
|
|
|
month = data['month']
|
|
|
|
year = data['year']
|
|
|
|
date = datetime(year, month, day, 12)
|
2020-05-22 19:55:14 +00:00
|
|
|
lockedDay = mainController.getLockedDay(date)
|
2020-03-11 17:32:57 +00:00
|
|
|
lockedDay = {
|
|
|
|
'date': {
|
|
|
|
'year': year,
|
|
|
|
'month': month,
|
|
|
|
'day': day
|
|
|
|
},
|
|
|
|
'locked': lockedDay['locked']
|
|
|
|
}
|
2020-03-10 08:19:11 +00:00
|
|
|
retVal = {
|
2020-05-22 19:55:14 +00:00
|
|
|
'worker': mainController.getWorker(date),
|
2020-03-10 08:19:11 +00:00
|
|
|
'day': lockedDay
|
2020-02-23 21:31:22 +00:00
|
|
|
}
|
2020-03-10 10:08:24 +00:00
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
|
|
|
return jsonify(retVal)
|
2020-03-10 08:19:11 +00:00
|
|
|
except Exception as err:
|
|
|
|
debug.debug("exception", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
2020-01-18 22:31:49 +00:00
|
|
|
|
2020-03-10 10:08:24 +00:00
|
|
|
|
2020-01-19 20:32:58 +00:00
|
|
|
@vorstand.route("/sm/deleteUser", methods=['POST'])
|
2020-03-05 20:24:32 +00:00
|
|
|
@login_required(groups=[MONEY, GASTRO, VORSTAND])
|
2020-01-19 20:32:58 +00:00
|
|
|
def _deletUser(**kwargs):
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.info("/sm/deletUser")
|
|
|
|
try:
|
|
|
|
data = request.get_json()
|
|
|
|
user = data['user']
|
|
|
|
day = data['day']
|
|
|
|
month = data['month']
|
|
|
|
year = data['year']
|
|
|
|
date = datetime(year, month, day, 12)
|
2020-05-22 19:55:14 +00:00
|
|
|
mainController.deleteWorker(user['username'], date)
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.debug("return ok")
|
2020-05-22 19:55:14 +00:00
|
|
|
user = mainController.getUser(user['username'])
|
2020-03-10 10:08:24 +00:00
|
|
|
jobL.info("Vorstand {} {} entfernt Mitglied {} {} am {} vom Dienst".format(
|
|
|
|
kwargs['accToken'].user.firstname, kwargs['accToken'].user.lastname, user.firstname, user.lastname, date.date()))
|
2020-03-10 08:19:11 +00:00
|
|
|
return jsonify({"ok": "ok"})
|
|
|
|
except Exception as err:
|
|
|
|
debug.debug("exception", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
2020-02-24 11:19:52 +00:00
|
|
|
|
2020-05-16 21:25:44 +00:00
|
|
|
@vorstand.route("/wgm/getAllWorkgroups", methods=['GET'])
|
|
|
|
@login_required(bar=True)
|
|
|
|
def _getAllWorkgroups(**kwargs):
|
|
|
|
try:
|
|
|
|
debug.info("get all workgroups")
|
2020-05-22 19:55:14 +00:00
|
|
|
retVal = mainController.getAllWorkgroups()
|
2020-05-16 21:25:44 +00:00
|
|
|
debug.info("return all workgroups {{ {} }}".format(retVal))
|
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
|
|
|
debug.warning("exception in get all workgroups.", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
|
|
|
|
|
|
|
@vorstand.route("/wgm/getWorkgroup", methods=['POST'])
|
|
|
|
@login_required(bar=True)
|
|
|
|
def _getWorkgroup(**kwargs):
|
|
|
|
try:
|
|
|
|
debug.info("get workgroup")
|
|
|
|
data = request.get_json()
|
|
|
|
name = data['name']
|
|
|
|
debug.info("get workgroup {{ {} }}".format(name))
|
2020-05-22 19:55:14 +00:00
|
|
|
retVal = mainController.getWorkgroups(name)
|
2020-05-16 21:25:44 +00:00
|
|
|
debug.info(
|
|
|
|
"return workgroup {{ {} }} : {{ {} }}".format(name, retVal))
|
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
|
|
|
debug.warning("exception in get workgroup.", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
|
|
|
|
|
|
|
@vorstand.route("/wgm/workgroup", methods=['POST', 'PUT', 'DELETE'])
|
|
|
|
@login_required(groups=[MONEY, GASTRO, VORSTAND])
|
|
|
|
def _workgroup(**kwargs):
|
|
|
|
debug.info("/wgm/workgroup")
|
|
|
|
try:
|
|
|
|
data = request.get_json()
|
|
|
|
if request.method == 'PUT':
|
|
|
|
name = data['name']
|
|
|
|
boss = None
|
|
|
|
if 'boss' in data:
|
|
|
|
boss = data['boss']
|
2020-05-22 19:55:14 +00:00
|
|
|
retVal = mainController.setWorkgroup(name, boss)
|
2020-05-16 21:25:44 +00:00
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
|
|
|
if request.method == 'POST':
|
2020-05-22 19:55:14 +00:00
|
|
|
retVal = mainController.updateWorkgroup(data)
|
2020-05-16 21:25:44 +00:00
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
|
|
|
debug.debug("exception", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
|
|
|
|
|
|
|
@vorstand.route("/wgm/deleteWorkgroup", methods=['POST'])
|
|
|
|
@login_required(groups=[VORSTAND])
|
|
|
|
def _deleteWorkgroup(**kwargs):
|
|
|
|
try:
|
|
|
|
data = request.get_json()
|
|
|
|
debug.info("/wgm/deleteWorkgroup")
|
2020-05-22 19:55:14 +00:00
|
|
|
mainController.deleteWorkgroup(data)
|
2020-05-16 21:25:44 +00:00
|
|
|
retVal = {"ok": "ok"}
|
|
|
|
debug.debug("return ok")
|
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
|
|
|
debug.debug("exception", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
|
|
|
|
2020-05-17 18:21:22 +00:00
|
|
|
@vorstand.route("/sm/getAllJobKinds", methods=['GET'])
|
|
|
|
@login_required(bar=True)
|
|
|
|
def _getAllJobKinds(**kwargs):
|
|
|
|
try:
|
|
|
|
debug.info("get all jobkinds")
|
2020-05-22 19:55:14 +00:00
|
|
|
retVal = mainController.getAllJobKinds()
|
2020-05-17 18:21:22 +00:00
|
|
|
debug.info("return all jobkinds {{ {} }}".format(retVal))
|
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
|
|
|
debug.warning("exception in get all workgroups.", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
|
|
|
|
|
|
|
@vorstand.route("/sm/getJobKind", methods=['POST'])
|
|
|
|
@login_required(bar=True)
|
|
|
|
def _getJobKinds(**kwargs):
|
|
|
|
try:
|
|
|
|
debug.info("get jobkind")
|
|
|
|
data = request.get_json()
|
|
|
|
name = data['name']
|
|
|
|
debug.info("get jobkind {{ {} }}".format(name))
|
2020-05-22 19:55:14 +00:00
|
|
|
retVal = mainController.getJobKind(name)
|
2020-05-17 18:21:22 +00:00
|
|
|
debug.info(
|
|
|
|
"return workgroup {{ {} }} : {{ {} }}".format(name, retVal))
|
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
|
|
|
debug.warning("exception in get workgroup.", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
|
|
|
|
|
|
|
@vorstand.route("/sm/JobKind", methods=['POST', 'PUT', 'DELETE'])
|
|
|
|
@login_required(groups=[MONEY, GASTRO, VORSTAND])
|
|
|
|
def _JobKinds(**kwargs):
|
|
|
|
debug.info("/sm/JobKind")
|
|
|
|
try:
|
|
|
|
data = request.get_json()
|
|
|
|
if request.method == 'PUT':
|
|
|
|
name = data['name']
|
2020-05-17 19:18:56 +00:00
|
|
|
workgroup = None
|
|
|
|
if 'workgroup' in data:
|
|
|
|
workgroup = data['workgroup']
|
2020-05-22 19:55:14 +00:00
|
|
|
retVal = mainController.setJobKind(name, workgroup)
|
2020-05-17 18:21:22 +00:00
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
|
|
|
if request.method == 'POST':
|
2020-05-22 19:55:14 +00:00
|
|
|
retVal = mainController.updateJobKind(data)
|
2020-05-17 18:21:22 +00:00
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
|
|
|
debug.debug("exception", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
|
|
|
|
|
|
|
@vorstand.route("/sm/deleteJobKind", methods=['POST'])
|
|
|
|
@login_required(groups=[VORSTAND])
|
|
|
|
def _deleteJobKind(**kwargs):
|
|
|
|
try:
|
|
|
|
data = request.get_json()
|
|
|
|
debug.info("/sm/deleteJobKind")
|
2020-05-22 19:55:14 +00:00
|
|
|
mainController.deleteJobKind(data)
|
2020-05-17 18:21:22 +00:00
|
|
|
retVal = {"ok": "ok"}
|
|
|
|
debug.debug("return ok")
|
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
|
|
|
debug.debug("exception", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
2020-03-10 10:08:24 +00:00
|
|
|
|
2020-05-22 19:55:14 +00:00
|
|
|
@vorstand.route("/jk/getJobKindDates", methods=['POST'])
|
|
|
|
@login_required()
|
|
|
|
def _getJobKindDates(**kwargs):
|
|
|
|
try:
|
|
|
|
debug.info("/jk/getJobKindDates")
|
|
|
|
data = request.get_json()
|
|
|
|
datum = date(data['year'], data['month'], data['day'])
|
|
|
|
retVal = mainController.getJobKindDates(datum)
|
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
|
|
|
debug.debug("exception", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
|
|
|
|
|
|
|
@vorstand.route("/jk/JobKindDate", methods=['POST'])
|
|
|
|
@login_required(groups=[VORSTAND])
|
|
|
|
def _jobKindDates(**kwargs):
|
|
|
|
try:
|
|
|
|
debug.info("/jk/JobKindDate")
|
|
|
|
data = request.get_json()
|
|
|
|
retVal = mainController.controllJobKindDates(data)
|
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
|
|
|
debug.debug("exception", exc_info=True)
|
|
|
|
return jsonify({"error": str(err)}), 500
|
|
|
|
|
2020-02-24 11:19:52 +00:00
|
|
|
@vorstand.route("/sm/lockDay", methods=['POST'])
|
2020-03-04 20:11:41 +00:00
|
|
|
@login_required(groups=[MONEY, GASTRO, VORSTAND])
|
2020-02-24 11:19:52 +00:00
|
|
|
def _lockDay(**kwargs):
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.info("/sm/lockDay")
|
2020-02-24 11:19:52 +00:00
|
|
|
try:
|
|
|
|
data = request.get_json()
|
|
|
|
year = data['year']
|
|
|
|
month = data['month']
|
|
|
|
day = data['day']
|
|
|
|
locked = data['locked']
|
|
|
|
date = datetime(year, month, day, 12)
|
2020-05-22 19:55:14 +00:00
|
|
|
lockedDay = mainController.setLockedDay(date, locked, True)
|
2020-02-24 11:19:52 +00:00
|
|
|
if not lockedDay:
|
|
|
|
retVal = {
|
|
|
|
'date': {
|
|
|
|
'year': year,
|
|
|
|
'month': month,
|
|
|
|
'day': day
|
|
|
|
},
|
|
|
|
'locked': False
|
|
|
|
}
|
|
|
|
else:
|
|
|
|
retVal = {
|
|
|
|
'date': {
|
|
|
|
'year': year,
|
|
|
|
'month': month,
|
|
|
|
'day': day
|
|
|
|
},
|
|
|
|
'locked': lockedDay['locked']
|
|
|
|
}
|
2020-03-10 10:08:24 +00:00
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
2020-02-24 11:19:52 +00:00
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.debug("exception", exc_info=True)
|
2020-03-04 20:11:41 +00:00
|
|
|
return jsonify({'error': err}), 409
|
|
|
|
|
2020-03-10 10:08:24 +00:00
|
|
|
|
2020-03-04 20:11:41 +00:00
|
|
|
@vorstand.route("/sm/searchWithExtern", methods=['GET'])
|
|
|
|
@login_required(groups=[VORSTAND])
|
|
|
|
def _search(**kwargs):
|
2020-03-10 08:19:11 +00:00
|
|
|
debug.info("/sm/searchWithExtern")
|
|
|
|
try:
|
|
|
|
retVal = ldap.getAllUser()
|
2020-03-10 10:08:24 +00:00
|
|
|
debug.debug("return {{ {} }}".format(retVal))
|
2020-03-10 08:19:11 +00:00
|
|
|
return jsonify(retVal)
|
|
|
|
except Exception as err:
|
|
|
|
debug.debug("exception", exc_info=True)
|
2020-03-10 10:08:24 +00:00
|
|
|
return jsonify({"error": str(err)}), 500
|