diff options
author | zsloan | 2020-08-29 13:47:52 -0500 |
---|---|---|
committer | zsloan | 2020-08-29 13:47:52 -0500 |
commit | dba31ef2aa9e3f89621848fdb79b915dbd3c56e2 (patch) | |
tree | 28a8445f9656fd1b10e78023a5024277f5aa5059 | |
parent | 58e621c4853a24fa2e87a06616286c64ef38dfa8 (diff) | |
download | genenetwork2-dba31ef2aa9e3f89621848fdb79b915dbd3c56e2.tar.gz |
Fixed issue where exporting traits would throw an error if a dataset's
group didn't have an InbredSetCode set in the DB
* wqflask/utility/authentication_tools.py - Changed get_group_code to
return an empty string instead of None if InbredSetCode doesn't exist
for a dataset group
* wqflask/wqflask/views.py - Changed zipped export filename to
"export_(datetime)" instead of "collection_(datetime)" since this export
can occur from both the collection page and the global search page
-rw-r--r-- | wqflask/utility/authentication_tools.py | 6 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/wqflask/utility/authentication_tools.py b/wqflask/utility/authentication_tools.py index ece7022c..3553b92b 100644 --- a/wqflask/utility/authentication_tools.py +++ b/wqflask/utility/authentication_tools.py @@ -76,8 +76,10 @@ def add_new_resource(dataset, trait_id=None): def get_group_code(dataset): results = g.db.execute("SELECT InbredSetCode from InbredSet where Name='{}'".format(dataset.group.name)).fetchone() - - return results[0] + if results[0]: + return results[0] + else: + return "" def check_admin(resource_id=None): the_url = "http://localhost:8080/available?resource={}&user={}".format(resource_id, g.user_session.user_id) diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index a898de43..91d1a279 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -419,7 +419,7 @@ def export_traits_csv(): if len(file_list) > 1: now = datetime.datetime.now() time_str = now.strftime('%H:%M_%d%B%Y') - filename = "collection_{}".format(time_str) + filename = "export_{}".format(time_str) memory_file = StringIO.StringIO() with ZipFile(memory_file, mode='w', compression=ZIP_DEFLATED) as zf: for the_file in file_list: |