aboutsummaryrefslogtreecommitdiff
path: root/uploader/species
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/species')
-rw-r--r--uploader/species/views.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/uploader/species/views.py b/uploader/species/views.py
index 77406a1..5de5277 100644
--- a/uploader/species/views.py
+++ b/uploader/species/views.py
@@ -8,8 +8,8 @@ from flask import (flash,
from uploader.population import popbp
from uploader.ui import make_template_renderer
-from uploader.authorisation import require_login
from uploader.db_utils import database_connection
+from uploader.authorisation import require_login, require_token
from .models import all_species, save_species, species_by_id
@@ -98,3 +98,23 @@ def create_species():
species = save_species(conn, common_name, scientific_name, taxon_id)
flash("Species saved successfully!", "alert-success")
return redirect(url_for("species.view_species", species_id=species["species_id"]))
+
+
+@speciesbp.route("/<int:species_id>/edit")
+@require_login
+@require_token
+#def edit_species(species_id: int):
+def edit_species(token: dict, species_id: int):
+ """Edit a species' details.
+
+ Parameters
+ ----------
+ token: A JWT token used for authorisation.
+ species_id: An identifier for the species being edited.
+ """
+ app.logger.debug("======================\n"
+ "Token: %s\n"
+ "SpeciesId: %s\n"
+ "======================",
+ token, species_id)
+ return "Would edit the species."