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