feat: add relative imports for python scripts (#1075)

* all

* all
This commit is contained in:
Ruben Fiszel
2023-01-09 13:49:30 +01:00
committed by GitHub
parent 32d90d4f18
commit 5347cd46a9
6 changed files with 110 additions and 8 deletions
+1 -4
View File
@@ -469,10 +469,7 @@ async fn raw_script_by_path(
Extension(user_db): Extension<UserDB>,
Path((w_id, path)): Path<(String, StripPath)>,
) -> Result<String> {
let path = path
.to_path()
.strip_suffix(".ts")
.ok_or_else(|| Error::BadRequest("Raw script path must end with .ts".to_string()))?;
let path = path.to_path().split(".").next().unwrap_or_default();
let mut tx = user_db.begin(&authed).await?;
let content_o = sqlx::query_scalar!(