diff --git a/projects/tentacles/src/python/tentacles/blueprints/file_ui.py b/projects/tentacles/src/python/tentacles/blueprints/file_ui.py index 660e9e8..e6f3ef7 100644 --- a/projects/tentacles/src/python/tentacles/blueprints/file_ui.py +++ b/projects/tentacles/src/python/tentacles/blueprints/file_ui.py @@ -64,6 +64,8 @@ def manipulate_files(): os.unlink(file.path) ctx.db.delete_file(uid=ctx.uid, fid=file.id) + ctx.db.delete_file_analysis_by_fid(fid=file.id) + ctx.db.delete_jobs_by_fid(uid=ctx.uid, fid=file.id) flash("File deleted", category="info") case _: diff --git a/projects/tentacles/src/python/tentacles/sql/files.sql b/projects/tentacles/src/python/tentacles/sql/files.sql index e475a64..ec0c01d 100644 --- a/projects/tentacles/src/python/tentacles/sql/files.sql +++ b/projects/tentacles/src/python/tentacles/sql/files.sql @@ -43,22 +43,23 @@ WHERE user_id = :uid ; --- name: delete-file*! -DELETE FROM jobs +-- name: delete-file! +DELETE FROM files WHERE user_id = :uid - AND file_id = :fid + AND id = :fid ; +-- name: delete-file-analysis-by-fid! DELETE FROM file_analysis WHERE file_id = :fid ; -DELETE FROM files +-- name: delete-file-analysis! +DELETE FROM file_analysis WHERE - user_id = :uid - AND id = :fid + id = :aid ; -- name: fetch-file^ diff --git a/projects/tentacles/src/python/tentacles/sql/jobs.sql b/projects/tentacles/src/python/tentacles/sql/jobs.sql index b9cb9f5..301c0c5 100644 --- a/projects/tentacles/src/python/tentacles/sql/jobs.sql +++ b/projects/tentacles/src/python/tentacles/sql/jobs.sql @@ -192,3 +192,10 @@ WHERE user_id = :uid AND id = :jid ; + +-- name: delete-jobs-by-fid! +DELETE FROM jobs +WHERE + user_id = :uid + AND file_id = :fid +; diff --git a/projects/tentacles/src/python/tentacles/templates/analysis_failure_email.html.j2 b/projects/tentacles/src/python/tentacles/templates/analysis_failure_email.html.j2 new file mode 100644 index 0000000..e089adf --- /dev/null +++ b/projects/tentacles/src/python/tentacles/templates/analysis_failure_email.html.j2 @@ -0,0 +1,45 @@ + + + + +
+ + + + + ++ Dear {{ username }}, +
+
+ We're sorry to inform you that the file {{ filename }}
you attempted to print has been rejected.
+
+ At this time, Tentacles requires that all submitted Gcode be generated by PrusaSlicer 2.0.0 or later, and + contain the PrusaSlicer emitted configuration metadata. This allows us to verify that the Gcode you've + submitted fits within the constraints of the printers we have available and choose an appropriately printer + for running the job. This protects our printers from damage and ensures that you get usable results. +
++ Please re-slice the object using PrusaSlicer and + re-submit the resulting Gcode. +
++ Thank you for your understanding +
+