Return 409 if torrent already exists

This commit is contained in:
sqozz 2018-12-28 07:35:45 +01:00
parent 11522b79f0
commit 4f6a4d2681

View file

@ -124,7 +124,7 @@ def create():
message = _("Successfully created torrent <a href=\"/search?h={}\">{}</a>").format(newTorrent.fileid, newTorrent.fileid[:-20]) message = _("Successfully created torrent <a href=\"/search?h={}\">{}</a>").format(newTorrent.fileid, newTorrent.fileid[:-20])
return render_template("create.html", categories=categories.categories, messages=[message], tracker=settings["valid_tracker"]) return render_template("create.html", categories=categories.categories, messages=[message], tracker=settings["valid_tracker"])
else: else:
return render_template("create.html", categories=categories.categories, errors=newTorrent.errors, tracker=settings["valid_tracker"]) return render_template("create.html", categories=categories.categories, errors=newTorrent.errors, tracker=settings["valid_tracker"]), 409
@app.route("/download/<filename>") @app.route("/download/<filename>")