Skip to content

Commit

Permalink
Use the newer decorator syntax (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartik Kumar authored Apr 16, 2023
1 parent 92d10c0 commit ef7e8af
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ class FilterTypeForm(FlaskForm):
}


@app.route("/", methods=["GET"])
@app.get("/")
def home():
title = "Saadhan by r/developersIndia"
return render_template("categories.html", categories=CATEGORIES, title=title)


@app.route("/resources", methods=["GET"])
@app.get("/resources")
def category():
category = request.args.get("category")

Expand All @@ -88,7 +88,7 @@ def category():
)


@app.route("/contributors", methods=["GET"])
@app.get("/contributors")
def contributors():
contributors = resourcer.Resource.get_all_contributors()
saadhan_contributors = resourcer.Resource.get_saadhan_contributors()
Expand All @@ -102,14 +102,14 @@ def contributors():
)


@app.route("/how-to-contribute", methods=["GET"])
@app.get("/how-to-contribute")
def how_to_contribute():
return render_template(
"how-to-contribute.html"
)


@app.route("/filtered_resources", methods=["POST"])
@app.post("/filtered_resources")
def filtered_resources():
rsr = resourcer.Resource(request.form.get("category"))
level_form = FilterLevelForm()
Expand Down

0 comments on commit ef7e8af

Please sign in to comment.