about summary refs log tree commit diff
path: root/uploader
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-11-03 13:53:39 -0600
committerFrederick Muriuki Muriithi2025-11-03 13:54:22 -0600
commit1ae0b5d4b296923dc3b342dd2cda0fc14c692e65 (patch)
treeec92a502597838e72bcdd0abf5b98d6f99aadd31 /uploader
parent59cf745ceeefe6d68baf7f856fa00bd8db0a4b89 (diff)
downloadgn-uploader-1ae0b5d4b296923dc3b342dd2cda0fc14c692e65.tar.gz
Use new "redirection-to-next" utilities.
Diffstat (limited to 'uploader')
-rw-r--r--uploader/phenotypes/views.py7
-rw-r--r--uploader/publications/views.py7
2 files changed, 12 insertions, 2 deletions
diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py
index d02018d..ac36ec8 100644
--- a/uploader/phenotypes/views.py
+++ b/uploader/phenotypes/views.py
@@ -41,6 +41,7 @@ from uploader.oauth2.client import oauth2_post
 from uploader.oauth2.tokens import request_token
 from uploader.authorisation import require_login
 from uploader.oauth2 import client as oauth2client
+from uploader.route_utils import build_next_argument
 from uploader.route_utils import generic_select_population
 from uploader.datautils import safe_int, enumerate_sequence
 from uploader.species.models import all_species, species_by_id
@@ -247,6 +248,12 @@ def view_phenotype(# pylint: disable=[unused-argument]
             has_se=any(bool(item.get("error")) for item in phenotype["data"]),
             publication=(phenotype_publication_data(conn, phenotype["Id"]) or {}),
             privileges=privileges,
+            next=build_next_argument(
+                uri="species.populations.phenotypes.view_phenotype",
+                species_id=species["SpeciesId"],
+                population_id=population["Id"],
+                dataset_id=dataset["Id"],
+                xref_id=xref_id),
             activelink="view-phenotype")
 
     def __fail__(error):
diff --git a/uploader/publications/views.py b/uploader/publications/views.py
index ee00e67..805d6f0 100644
--- a/uploader/publications/views.py
+++ b/uploader/publications/views.py
@@ -12,6 +12,7 @@ from flask import (
     current_app as app)
 
 from uploader.authorisation import require_login
+from uploader.route_utils import redirect_to_next
 
 from .models import (
     delete_publications,
@@ -147,8 +148,10 @@ def edit_publication(publication_id: int):
 
         flash("Successfully updated the publication details.",
               "alert-success")
-        return redirect(url_for(
-            "publications.view_publication", publication_id=publication_id))
+        return redirect_to_next({
+            "uri": "publications.view_publication",
+            "publication_id": publication_id
+        })
 
 
 @pubbp.route("/delete/<int:publication_id>", methods=["GET", "POST"])