aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/metadata_edits.py5
-rw-r--r--wqflask/wqflask/templates/edit_phenotype.html4
2 files changed, 5 insertions, 4 deletions
diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py
index 49b03943..10022ae1 100644
--- a/wqflask/wqflask/metadata_edits.py
+++ b/wqflask/wqflask/metadata_edits.py
@@ -130,7 +130,7 @@ def edit_phenotype(conn, name, dataset_id):
data_.get("new"),
"\n".join(
difflib.ndiff(
- [data_.get("old")], [data_.get("new")]
+ [data_.get("old") or ""], [data_.get("new")]
)
),
),
@@ -357,6 +357,7 @@ def update_phenotype(dataset_id: str, name: str):
}
)
publication_ = {
+ "pubmed_id": data_.get("pubmed-id"),
"abstract": data_.get("abstract"),
"authors": data_.get("authors"),
"title": data_.get("title"),
@@ -373,7 +374,7 @@ def update_phenotype(dataset_id: str, name: str):
"Publication",
data=Publication(**publication_),
where=Publication(
- id_=data_.get("pubmed-id", data_.get("old_id_"))
+ id_=data_.get("old_id_")
),
)
if updated_publications:
diff --git a/wqflask/wqflask/templates/edit_phenotype.html b/wqflask/wqflask/templates/edit_phenotype.html
index b90c7daf..617848ad 100644
--- a/wqflask/wqflask/templates/edit_phenotype.html
+++ b/wqflask/wqflask/templates/edit_phenotype.html
@@ -81,8 +81,8 @@
Description will be ignored. Do not enter any non-digit
character in this field. -->
<div class="col-sm-7 col-lg-8">
- <textarea name="pubmed-id" class="form-control" rows="1">{{ publish_xref.publication_id |default('', true) }}</textarea>
- <input name="old_id_" class="changed" type="hidden" value="{{ publish_xref.publication_id |default('', true) }}"/>
+ <textarea name="pubmed-id" class="form-control" rows="1">{{ publication.pubmed_id |default('', true) }}</textarea>
+ <input name="old_id_" class="changed" type="hidden" value="{{ publication.id_ |default('', true) }}"/>
</div>
</div>
<div class="form-group">