@@ -491,6 +491,7 @@ def query_project_barcode_stats(body, token_info, strip_sampleid):
491
491
def query_barcode_stats (body , token_info , strip_sampleid ):
492
492
validate_admin_access (token_info )
493
493
if 'sample_barcodes' in body :
494
+ project_id = None
494
495
barcodes = body ["sample_barcodes" ]
495
496
elif 'project_id' in body :
496
497
project_id = body ["project_id" ]
@@ -502,7 +503,7 @@ def query_barcode_stats(body, token_info, strip_sampleid):
502
503
unprocessed_barcodes = barcodes [1000 :]
503
504
barcodes = barcodes [0 :1000 ]
504
505
505
- results = {'samples' : per_sample (None , barcodes , strip_sampleid )}
506
+ results = {'samples' : per_sample (project_id , barcodes , strip_sampleid )}
506
507
507
508
if unprocessed_barcodes :
508
509
results ['partial_result' ] = True
@@ -835,6 +836,7 @@ def delete_account(account_id, token_info):
835
836
src_repo = SourceRepo (t )
836
837
samp_repo = SampleRepo (t )
837
838
sar_repo = SurveyAnswersRepo (t )
839
+ interested_users_repo = InterestedUserRepo (t )
838
840
839
841
acct = acct_repo .get_account (account_id )
840
842
if acct is None :
@@ -872,6 +874,8 @@ def delete_account(account_id, token_info):
872
874
873
875
acct_repo .scrub (account_id )
874
876
877
+ interested_users_repo .scrub (acct .email )
878
+
875
879
t .commit ()
876
880
877
881
return None , 204
@@ -885,15 +889,16 @@ def ignore_removal_request(account_id, token_info):
885
889
try :
886
890
# remove the user from the queue, noting the admin who allowed it
887
891
# and the time the action was performed.
888
- rq_repo .update_queue (account_id , token_info ['email' ], 'ignored' )
892
+ rq_repo .update_queue (account_id , token_info ['email' ],
893
+ 'ignored' , None )
889
894
t .commit ()
890
895
except RepoException as e :
891
896
raise e
892
897
893
898
return None , 204
894
899
895
900
896
- def allow_removal_request (account_id , token_info ):
901
+ def allow_removal_request (account_id , token_info , delete_reason ):
897
902
validate_admin_access (token_info )
898
903
899
904
with Transaction () as t :
@@ -902,7 +907,8 @@ def allow_removal_request(account_id, token_info):
902
907
try :
903
908
# remove the user from the queue, noting the admin who allowed it
904
909
# and the time the action was performed.
905
- rq_repo .update_queue (account_id , token_info ['email' ], 'deleted' )
910
+ rq_repo .update_queue (account_id , token_info ['email' ],
911
+ 'deleted' , delete_reason )
906
912
t .commit ()
907
913
except RepoException as e :
908
914
raise e
0 commit comments