finished ##168
This commit is contained in:
parent
e1b0d46771
commit
e3bf18a927
|
@ -53,24 +53,9 @@ def _saveConfig(**kwargs):
|
||||||
|
|
||||||
@user.route("/user/job", methods=['POST'])
|
@user.route("/user/job", methods=['POST'])
|
||||||
@login_required(groups=[USER])
|
@login_required(groups=[USER])
|
||||||
def _getJob(**kwargs):
|
def _getUser(**kwargs):
|
||||||
try:
|
|
||||||
if 'accToken' in kwargs:
|
|
||||||
accToken = kwargs['accToken']
|
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
date = datetime.utcfromtimestamp(int(data['date']))
|
date = datetime.utcfromtimestamp(int(data['date']))
|
||||||
test = userController.getWorker(date, username=accToken.user.uid)
|
retVal = userController.getWorker(date)
|
||||||
if test == [None]:
|
print(retVal)
|
||||||
job = False
|
return jsonify(retVal)
|
||||||
else:
|
|
||||||
job = True
|
|
||||||
if job:
|
|
||||||
workers = userController.getWorker(date)
|
|
||||||
for worker in workers:
|
|
||||||
if worker['user']['uid'] == accToken.user.uid:
|
|
||||||
workers.remove(worker)
|
|
||||||
return jsonify({'job': job, 'workers': workers})
|
|
||||||
return jsonify({'job': job})
|
|
||||||
except Exception as err:
|
|
||||||
traceback.print_exc()
|
|
||||||
return jsonify({"error": str(err)}), 409
|
|
Loading…
Reference in New Issue