Skip to content

Commit

Permalink
really awkward slug test
Browse files Browse the repository at this point in the history
  • Loading branch information
HoodieRocks committed Dec 29, 2023
1 parent dfc8efb commit bd40071
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions routes/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,12 @@ def create_new_project():

if not re.match(r'^[\w!@$()`.+,"\-\']{3,64}$', data["url"]):
return "URL is invalid!", 400

conn = util.make_connection()
other_project_with_slug = util.exec_query(conn, "SELECT url FROM projects WHERE url = :slug", slug=data["url"]).first()

if other_project_with_slug is not None:
return "A project with that URL already exists!", 400

icon = None
if data.get("icon"):
Expand Down

0 comments on commit bd40071

Please sign in to comment.