aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2021-10-28 12:53:26 +0300
committerBonfaceKilz2021-11-04 15:22:41 +0300
commit28f67d85416c48c2196dff889bfab8e9659aa5b6 (patch)
treecbc740e4888057dd1e3b011bcfda3f1531de581f
parent482c19955b5b757ad6b79102c832678ae7339d20 (diff)
downloadgenenetwork2-28f67d85416c48c2196dff889bfab8e9659aa5b6.tar.gz
Add "login_required" decorator to metadata edit endpoints
-rw-r--r--wqflask/wqflask/metadata_edits.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py
index d232b32b..fad9c315 100644
--- a/wqflask/wqflask/metadata_edits.py
+++ b/wqflask/wqflask/metadata_edits.py
@@ -11,6 +11,7 @@ from flask import (Blueprint, current_app, redirect,
from itertools import groupby
from wqflask.decorators import edit_access_required
+from wqflask.decorators import login_required
from gn3.db import diff_from_dict
from gn3.db import fetchall
@@ -118,6 +119,7 @@ def edit_probeset(conn, name):
@metadata_edit.route("/<dataset_id>/traits/<name>")
@edit_access_required
+@login_required
def display_phenotype_metadata(dataset_id: str, name: str):
conn = MySQLdb.Connect(db=current_app.config.get("DB_NAME"),
user=current_app.config.get("DB_USER"),
@@ -138,6 +140,7 @@ def display_phenotype_metadata(dataset_id: str, name: str):
@metadata_edit.route("/traits/<name>")
@edit_access_required
+@login_required
def display_probeset_metadata(name: str):
conn = MySQLdb.Connect(db=current_app.config.get("DB_NAME"),
user=current_app.config.get("DB_USER"),
@@ -156,6 +159,7 @@ def display_probeset_metadata(name: str):
@metadata_edit.route("/<dataset_id>/traits/<name>", methods=("POST",))
@edit_access_required
+@login_required
def update_phenotype(dataset_id: str, name: str):
conn = MySQLdb.Connect(db=current_app.config.get("DB_NAME"),
user=current_app.config.get("DB_USER"),
@@ -283,6 +287,7 @@ def update_phenotype(dataset_id: str, name: str):
@metadata_edit.route("/traits/<name>", methods=("POST",))
@edit_access_required
+@login_required
def update_probeset(name: str):
conn = MySQLdb.Connect(db=current_app.config.get("DB_NAME"),
user=current_app.config.get("DB_USER"),