mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 04:12:45 +00:00 
			
		
		
		
	Reviewed User package and invite user optical fix
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
			
		||||
from flask import abort, current_app, jsonify
 | 
			
		||||
from flask import abort, current_app
 | 
			
		||||
from flask_login import current_user, login_required
 | 
			
		||||
from threading import Thread
 | 
			
		||||
import os
 | 
			
		||||
@@ -7,6 +7,7 @@ from app.decorators import admin_required, content_negotiation
 | 
			
		||||
from app.models import Job, JobStatus
 | 
			
		||||
from . import bp
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bp.route('/<hashid:job_id>', methods=['DELETE'])
 | 
			
		||||
@login_required
 | 
			
		||||
@content_negotiation(produces='application/json')
 | 
			
		||||
@@ -26,12 +27,10 @@ def delete_job(job_id):
 | 
			
		||||
    )
 | 
			
		||||
    thread.start()
 | 
			
		||||
    response_data = {
 | 
			
		||||
        'message': \
 | 
			
		||||
            f'Job "{job.title}" marked for deletion'
 | 
			
		||||
        'message': f'Job "{job.title}" marked for deletion'
 | 
			
		||||
    }
 | 
			
		||||
    response = jsonify(response_data)
 | 
			
		||||
    response.status_code = 202
 | 
			
		||||
    return response
 | 
			
		||||
    return response_data, 202
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bp.route('/<hashid:job_id>/log')
 | 
			
		||||
@login_required
 | 
			
		||||
@@ -48,9 +47,7 @@ def job_log(job_id):
 | 
			
		||||
        'message': '',
 | 
			
		||||
        'jobLog': log
 | 
			
		||||
    }
 | 
			
		||||
    response = jsonify(response_data)
 | 
			
		||||
    response.status_code = 200
 | 
			
		||||
    return response
 | 
			
		||||
    return response_data, 200
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bp.route('/<hashid:job_id>/restart', methods=['POST'])
 | 
			
		||||
@@ -75,9 +72,6 @@ def restart_job(job_id):
 | 
			
		||||
    )
 | 
			
		||||
    thread.start()
 | 
			
		||||
    response_data = {
 | 
			
		||||
        'message': \
 | 
			
		||||
            f'Job "{job.title}" marked for restarting'
 | 
			
		||||
        'message': f'Job "{job.title}" marked for restarting'
 | 
			
		||||
    }
 | 
			
		||||
    response = jsonify(response_data)
 | 
			
		||||
    response.status_code = 202
 | 
			
		||||
    return response
 | 
			
		||||
    return response_data, 202
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user