Compare commits
No commits in common. "9f58682689a6073bc9a937a679e1f37024181d93" and "9959c7dec2cd5fbce23990131958876592870736" have entirely different histories.
9f58682689
...
9959c7dec2
1 changed files with 3 additions and 8 deletions
11
web/api.py
11
web/api.py
|
|
@ -7,7 +7,6 @@ import glob as _glob
|
||||||
import logging
|
import logging
|
||||||
import mimetypes
|
import mimetypes
|
||||||
import shutil
|
import shutil
|
||||||
import sqlite3
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
@ -446,13 +445,9 @@ def create_project_link(body: ProjectLinkCreate):
|
||||||
if not models.get_project(conn, body.to_project):
|
if not models.get_project(conn, body.to_project):
|
||||||
conn.close()
|
conn.close()
|
||||||
raise HTTPException(404, f"Project '{body.to_project}' not found")
|
raise HTTPException(404, f"Project '{body.to_project}' not found")
|
||||||
try:
|
link = models.create_project_link(
|
||||||
link = models.create_project_link(
|
conn, body.from_project, body.to_project, body.type, body.description
|
||||||
conn, body.from_project, body.to_project, body.type, body.description
|
)
|
||||||
)
|
|
||||||
except sqlite3.IntegrityError:
|
|
||||||
conn.close()
|
|
||||||
raise HTTPException(409, "Link already exists")
|
|
||||||
conn.close()
|
conn.close()
|
||||||
return link
|
return link
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue