about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/metadata_edits.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py
index 109ed65e..c78d8151 100644
--- a/wqflask/wqflask/metadata_edits.py
+++ b/wqflask/wqflask/metadata_edits.py
@@ -297,17 +297,19 @@ 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", ""),
-        "title": data_.get("title"),
-        "journal": data_.get("journal"),
-        "volume": data_.get("volume"),
-        "pages": data_.get("pages"),
-        "month": data_.get("month"),
-        "year": data_.get("year", 0),
-    }
+        publication_ = {
+            key: val for key, val in {
+                "pubmed_id": data_.get("pubmed-id"),
+                "abstract": data_.get("abstract"),
+                "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"),
+            }.items() if val is not None
+        }
     updated_publications = ""
     with database_connection(get_setting("SQL_URI")) as conn:
         existing_publication = (# fetch publication