Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Commit

Permalink
Return 304 on archive POST if already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
le717 committed Aug 17, 2021
1 parent 42948a7 commit c5b64ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions configuration/development.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"appConfig": {
"DEBUG": true
"DEBUG": true,
"DOWNLOADS_DIR": "../static/downloads"
}
}
}
5 changes: 5 additions & 0 deletions src/blueprints/v1/public/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ def get():
@archive.route("/", methods=["POST"])
def post():
"""Generate a new Prompt archive spreadsheet."""
# Don't do anything if an archive has already been made
latest_archive = get()
if isinstance(latest_archive, dict):
return helpers.make_response(304)

database.archive.make(
{
"base_name": BASE_FILE_NAME,
Expand Down

0 comments on commit c5b64ce

Please sign in to comment.