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 /wqflask/utility/authentication_tools.py | |
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
Diffstat (limited to 'wqflask/utility/authentication_tools.py')
-rw-r--r-- | wqflask/utility/authentication_tools.py | 6 |
1 files changed, 4 insertions, 2 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) |