aboutsummaryrefslogtreecommitdiff
path: root/uploader/population/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/population/views.py')
-rw-r--r--uploader/population/views.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/uploader/population/views.py b/uploader/population/views.py
index cd5e20b..3be46d4 100644
--- a/uploader/population/views.py
+++ b/uploader/population/views.py
@@ -21,7 +21,7 @@ popbp = Blueprint("populations", __name__)
render_template = make_template_renderer("populations")
-@popbp.route("/", methods=["GET", "POST"])
+@popbp.route("/populations", methods=["GET", "POST"])
@require_login
def index():
"""Entry point for populations."""
@@ -33,11 +33,11 @@ def index():
species = species_by_id(conn, request.args.get("species_id"))
if not bool(species):
flash("Invalid species identifier provided!", "alert-danger")
- return redirect(url_for("populations.index"))
- return redirect(url_for("populations.list_species_populations",
+ return redirect(url_for("species.populations.index"))
+ return redirect(url_for("species.populations.list_species_populations",
species_id=species["SpeciesId"]))
-@popbp.route("/<int:species_id>", methods=["GET"])
+@popbp.route("/<int:species_id>/populations", methods=["GET"])
@require_login
def list_species_populations(species_id: int):
"""List a particular species' populations."""
@@ -45,7 +45,7 @@ def list_species_populations(species_id: int):
species = species_by_id(conn, species_id)
if not bool(species):
flash("No species was found for given ID.", "alert-danger")
- return redirect(url_for("populations.index"))
+ return redirect(url_for("species.populations.index"))
return render_template(
"populations/list-populations.html",
species=species,
@@ -95,7 +95,7 @@ def create_population(species_id: int):
error = True
if error:
- return redirect(url_for("populations.create_population",
+ return redirect(url_for("species.populations.create_population",
**dict(request.args)))
new_population = save_population(conn, {
@@ -107,7 +107,7 @@ def create_population(species_id: int):
"Description": request.form.get("description") or None
})
- return redirect(url_for("populations.view_population",
+ return redirect(url_for("species.populations.view_population",
species_id=species["SpeciesId"],
population_id=new_population["InbredSetId"]))