aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-07-24 11:05:30 +0300
committerFrederick Muriuki Muriithi2023-07-24 11:06:57 +0300
commit8f9a857a911209f882dec4b50b8ee148a6267f64 (patch)
treeeeabe062cbbf43c131a6554d2e81ccb27318d536
parent53df82468cac6568183b3706f6e8cb391d5e3353 (diff)
downloadgenenetwork2-8f9a857a911209f882dec4b50b8ee148a6267f64.tar.gz
Fix bugs
* Add missing `.now()` * Provide defaults (not `None`) for required fields
-rw-r--r--wqflask/wqflask/metadata_edits.py4
-rw-r--r--wqflask/wqflask/templates/edit_phenotype.html2
2 files changed, 3 insertions, 3 deletions
diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py
index 7a8bbc77..c8d104ea 100644
--- a/wqflask/wqflask/metadata_edits.py
+++ b/wqflask/wqflask/metadata_edits.py
@@ -297,13 +297,13 @@ View the diffs <a href='{url}' target='_blank'>here</a>", "success")
publication_ = {
"pubmed_id": data_.get("pubmed-id"),
"abstract": data_.get("abstract"),
- "authors": data_.get("authors"),
+ "authors": data_.get("authors", ""),
"title": data_.get("title"),
"journal": data_.get("journal"),
"volume": data_.get("volume"),
"pages": data_.get("pages"),
"month": data_.get("month"),
- "year": data_.get("year"),
+ "year": data_.get("year", 0),
}
updated_publications = ""
with database_connection(get_setting("SQL_URI")) as conn:
diff --git a/wqflask/wqflask/templates/edit_phenotype.html b/wqflask/wqflask/templates/edit_phenotype.html
index e8335487..33353c90 100644
--- a/wqflask/wqflask/templates/edit_phenotype.html
+++ b/wqflask/wqflask/templates/edit_phenotype.html
@@ -166,7 +166,7 @@
<label for="month" class="col-sm-3 col-lg-2 control-label text-left">Month</label>
<div class="col-sm-7 col-lg-8">
<select id="month" name="month" class="form-control">
- {%set selected_month =(publication.month or datetime.datetime.strftime("%b"))%}
+ {%set selected_month =(publication.month or datetime.datetime.now().strftime("%b"))%}
{%for smonth, lmonth in (("Jan", "January"),("Feb", "February"),("Mar", "March"),("Apr", "April"),("May", "May"),("Jun", "Jun"),("Jul", "July"),("Aug", "August"),("Sep", "September"),("Oct", "October"),("Nov", "November"),("Dec", "December"))%}
<option value="{{smonth}}"
{%if smonth == selected_month%}