The School year rollover button is placed in the school settings.
Release Inventarsystem / release-docker (push) Successful in 2m16s
Release Inventarsystem / release-docker (push) Successful in 2m16s
This commit is contained in:
-63
@@ -228,7 +228,6 @@ def rollover_student_card_classes(dry_run=False, *, max_class=None, graduate_lab
|
||||
client.close()
|
||||
|
||||
|
||||
# Admin route to trigger rollover manually
|
||||
@app.route('/admin/trigger_school_year_rollover', methods=['POST'])
|
||||
def admin_trigger_school_year_rollover():
|
||||
if 'username' not in session:
|
||||
@@ -3038,42 +3037,6 @@ def optimized_image(filename):
|
||||
app.logger.error(f"Error serving optimized image {filename}: {str(e)}")
|
||||
return Response("Optimized image not found", status=404)
|
||||
|
||||
|
||||
# @app.route('/QRCodes/<filename>')
|
||||
# def qrcode_file(filename):
|
||||
# """
|
||||
# Serve QR code files from the QRCodes directory.
|
||||
#
|
||||
# Args:
|
||||
# filename (str): Name of the QR code file to serve
|
||||
#
|
||||
# Returns:
|
||||
# flask.Response: The requested QR code file or placeholder image if not found
|
||||
# """
|
||||
# try:
|
||||
# # Check production path first
|
||||
# prod_path = "/var/Inventarsystem/Web/QRCodes"
|
||||
# dev_path = app.config['QR_CODE_FOLDER']
|
||||
# if os.path.exists(os.path.join(prod_path, filename)):
|
||||
# return send_from_directory(prod_path, filename)
|
||||
# if os.path.exists(os.path.join(dev_path, filename)):
|
||||
# return send_from_directory(dev_path, filename)
|
||||
#
|
||||
# # Use a placeholder image if file not found - first try SVG, then PNG
|
||||
# svg_placeholder_path = os.path.join(app.static_folder, 'img', 'no-image.svg')
|
||||
# png_placeholder_path = os.path.join(app.static_folder, 'img', 'no-image.png')
|
||||
#
|
||||
# if os.path.exists(svg_placeholder_path):
|
||||
# return send_from_directory(app.static_folder, 'img/no-image.svg')
|
||||
# elif os.path.exists(png_placeholder_path):
|
||||
# return send_from_directory(app.static_folder, 'img/no-image.png')
|
||||
# else:
|
||||
# return send_from_directory(app.static_folder, 'favicon.ico')
|
||||
# except Exception as e:
|
||||
# print(f"Error serving QR code {filename}: {str(e)}")
|
||||
# return Response("QR code not found", status=404)
|
||||
|
||||
|
||||
@app.route('/<path:filename>')
|
||||
def catch_all_files(filename):
|
||||
"""
|
||||
@@ -3136,32 +3099,6 @@ def test_connection():
|
||||
"""
|
||||
return {'status': 'success', 'message': 'Connection successful', 'status_code': 200}
|
||||
|
||||
""" if sucess in deployment the funktion can be removed
|
||||
@app.route('/user_status')
|
||||
def user_status():
|
||||
|
||||
API endpoint to get the current user's status (username, admin status).
|
||||
Used by JavaScript in templates to personalize the UI.
|
||||
|
||||
Returns:
|
||||
JSON: User status information or error if not authenticated
|
||||
|
||||
if 'username' in session:
|
||||
is_admin = us.check_admin(session['username'])
|
||||
return jsonify({
|
||||
'authenticated': True,
|
||||
'username': session['username'],
|
||||
'is_admin': is_admin
|
||||
})
|
||||
else:
|
||||
return jsonify({
|
||||
'authenticated': False,
|
||||
'error': 'Not logged in'
|
||||
}), 401
|
||||
"""
|
||||
|
||||
|
||||
##################################################### changes to be made to account for the new account permison managment system ##############################
|
||||
|
||||
@app.route('/')
|
||||
def home():
|
||||
|
||||
Reference in New Issue
Block a user