Skip to content

Commit

Permalink
Return 404 for plugins that don't exist (#1226)
Browse files Browse the repository at this point in the history
  • Loading branch information
richaagarwal committed Aug 18, 2023
1 parent d49be77 commit 3f42706
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/api/app.py
Expand Up @@ -84,7 +84,10 @@ def plugins() -> Response:
@app.route("/plugins/<plugin>", defaults={"version": None})
@app.route("/plugins/<plugin>/versions/<version>")
def versioned_plugin(plugin: str, version: str = None) -> Response:
return jsonify(plugin_model.get_plugin(plugin, version))
plugin = plugin_model.get_plugin(plugin, version)
if not plugin:
return app.make_response(("Plugin does not exist", 404))
return jsonify(plugin)


@app.route("/plugin/home/sections/<sections>")
Expand Down

0 comments on commit 3f42706

Please sign in to comment.