Fix Cantaloupe Sync: use sys.executable + add Excel file upload button
- Changed subprocess from 'python' to 'sys.executable' (fixes FileNotFoundError
in systemd — venv python not in system PATH)
- Added '📤 Upload Excel' button to admin frontend sync page
- uploadSyncFile() sends file to the same /api/admin/cantaloupe/sync endpoint
(which already supported file upload — frontend just didn't expose it)
- Users can now use 'Sync Now' for auto-download or 'Upload Excel' for manual
This commit is contained in:
+2
-1
@@ -419,9 +419,10 @@ async def run_sync(
|
||||
# Try subprocess call to cantaloupe export
|
||||
try:
|
||||
import subprocess
|
||||
import sys
|
||||
cantaloupe_dir = os.path.expanduser("~/projects/cantaloupe-downloader")
|
||||
result = subprocess.run(
|
||||
["python", "-m", "cantaloupe", "export", "--scheduled"],
|
||||
[sys.executable, "-m", "cantaloupe", "export", "--scheduled"],
|
||||
capture_output=True, text=True, timeout=120,
|
||||
cwd=cantaloupe_dir,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user