Skip to content

Commit

Permalink
Throw error if neither ref nor version are given
Browse files Browse the repository at this point in the history
  • Loading branch information
kip93 committed Nov 11, 2023
1 parent 1a3fe3f commit 0f22bd6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/flakestry/api/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ def publish(
elif publish.version:
ref = f"refs/tags/{publish.version}"
else:
ref = "HEAD"
return JSONResponse(
status_code=status.HTTP_400_BAD_REQUEST,
content={"message": 'Neither "ref" nor "version" were provided'},
)

# Get info on the commit to be published
commit_response = requests.get(
Expand Down

0 comments on commit 0f22bd6

Please sign in to comment.