From 5b644c0f0ba4326f97176c0dd4a615a8e9684917 Mon Sep 17 00:00:00 2001 From: Jorge Boucas Date: Tue, 6 Feb 2024 10:49:58 +0100 Subject: [PATCH] issues with nones on ftp_user --- routes/apps/_utils.py | 2 +- routes/apps/crispr.py | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/routes/apps/_utils.py b/routes/apps/_utils.py index aa5a29e1..fb816739 100644 --- a/routes/apps/_utils.py +++ b/routes/apps/_utils.py @@ -547,7 +547,7 @@ def send_submission_ftp_email(user,submission_type,submission_tag, submission_fi today=str(date.today()) - if ftp_user == "" : + if ( ftp_user == "" ) or ( not ftp_user) : ftp_user=user_generator() ftp_pass=password_generator() diff --git a/routes/apps/crispr.py b/routes/apps/crispr.py index f12207f5..145f9d55 100644 --- a/routes/apps/crispr.py +++ b/routes/apps/crispr.py @@ -1411,15 +1411,12 @@ def writeout(subdic=subdic, json_config=json_config, json_filename=json_filename ftp_user=send_submission_ftp_email(user=current_user, submission_type="crispr", submission_tag=json_filename, submission_file=json_filename, attachment_path=json_filename, ftp_user=ftp) arguments=pd.concat([arguments,ftp_user]) ftp_user=ftp_user["Value"].tolist()[0] - raw_folder=json_config[os.path.basename(json_filename)]["raven"]["raw_fastq"] + raw_folder=json_config[json_filename_]["raven"]["raw_fastq"] raw_folder=os.path.join( raw_folder, ftp_user ) - json_config[os.path.basename(json_filename)]["raven"]["ftp"]=ftp_user - json_config[os.path.basename(json_filename)]["studio"]["ftp"]=ftp_user - - - ## keep on from here - json_config[os.path.basename(json_filename)]["raven"]["raw_fastq"]=raw_folder - json_config[os.path.basename(json_filename)]["studio"]["raw_fastq"]=raw_folder + json_config[json_filename_]["raven"]["ftp"]=ftp_user + json_config[json_filename_]["studio"]["ftp"]=ftp_user + json_config[json_filename_]["raven"]["raw_fastq"]=raw_folder + json_config[json_filename_]["studio"]["raw_fastq"]=raw_folder if BAGEL_NONESSENTIAL != "/bagel/NEGv1.txt" : json_config[os.path.basename(json_filename)]["raven"]["bagel_nonessential"]=os.path.join(raw_folder,BAGEL_NONESSENTIAL)