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