can create
This commit is contained in:
@@ -17,10 +17,10 @@ def vsc_like(user_uuid, user_id, course_id, chapter_name, lesson_name):
|
||||
session['chapter_name'] = chapter_name
|
||||
session['lesson_name'] = lesson_name
|
||||
config = load_config(path)
|
||||
if not config:
|
||||
return jsonify({"error": "Configuration file not found or invalid"}), 404
|
||||
if config.get('uuid') != uuid:
|
||||
return jsonify({"error": "UUID does not match"}), 403
|
||||
# if not config:
|
||||
# return jsonify({"error": "Configuration file not found or invalid"}), 404
|
||||
# if config.get('uuid') != uuid:
|
||||
# return jsonify({"error": "UUID does not match"}), 403
|
||||
|
||||
user_root = os.path.join(base_path, user_id)
|
||||
try:
|
||||
@@ -47,7 +47,7 @@ def vsc_like(user_uuid, user_id, course_id, chapter_name, lesson_name):
|
||||
print(f"Error adding user {user_id} to shared_group: {e}")
|
||||
|
||||
try:#将文件
|
||||
subprocess.run(["sudo", "chown", "-R", f"shared_group_{user_id}", path], check=True)
|
||||
subprocess.run(["sudo", "chown", "-R", f"{user_id}:shared_group_{user_id}", path], check=True)
|
||||
subprocess.run(["sudo", "chmod", "-R", "770", path], check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Error changing directory {path} to shared_group_{user_id}: {e}")
|
||||
|
||||
Reference in New Issue
Block a user