@@ -157,8 +157,6 @@ def get_registrations(reg_id=None, submitter_code=None):
157
157
query = f"""SELECT DISTINCT
158
158
registrations.registration_id,
159
159
registrations.posted_date,
160
- registrations.applicable_period_start,
161
- registrations.applicable_period_end,
162
160
registrations.submitting_for_self,
163
161
registrations.registration_status,
164
162
registrations.org_type,
@@ -203,8 +201,6 @@ def create_registration(form, renewal=False):
203
201
cur = conn .cursor ()
204
202
operation = """INSERT INTO registrations(
205
203
posted_date,
206
- applicable_period_start,
207
- applicable_period_end,
208
204
submitting_for_self,
209
205
registration_status,
210
206
org_type,
@@ -214,12 +210,10 @@ def create_registration(form, renewal=False):
214
210
state,
215
211
zip,
216
212
registration_year
217
- ) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s )
213
+ ) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)
218
214
RETURNING registration_id"""
219
215
values = (
220
216
datetime .now (),
221
- None ,
222
- None ,
223
217
True if form ['on-behalf-of' ] == 'true' else False ,
224
218
'Received' ,
225
219
form ['type' ],
@@ -702,65 +696,6 @@ def delete_registration_contact(reg_id, cont_id):
702
696
conn .close ()
703
697
704
698
705
- def create_submitter (form , reg_data ):
706
- cur = None
707
- conn = None
708
- try :
709
- conn = psycopg .connect (
710
- host = APCD_DB ['host' ],
711
- dbname = APCD_DB ['database' ],
712
- user = APCD_DB ['user' ],
713
- password = APCD_DB ['password' ],
714
- port = APCD_DB ['port' ],
715
- sslmode = 'require'
716
- )
717
- cur = conn .cursor ()
718
- operation = """INSERT INTO submitters(
719
- registration_id,
720
- org_name,
721
- file_me,
722
- file_pv,
723
- file_mc,
724
- file_pc,
725
- file_dc,
726
- submitting_for_self,
727
- submitter_code,
728
- payor_code,
729
- encryption_key,
730
- created_at,
731
- status
732
- ) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)
733
- RETURNING submitter_id"""
734
- values = (
735
- reg_data [0 ],
736
- reg_data [13 ],
737
- reg_data [6 ],
738
- reg_data [5 ],
739
- reg_data [4 ],
740
- reg_data [7 ],
741
- reg_data [8 ],
742
- reg_data [9 ],
743
- form ['submit_code' ],
744
- _set_int (form ['payor_code' ]),
745
- form ['encryption_key' ],
746
- datetime .now (),
747
- 'new'
748
- )
749
- cur .execute (operation , values )
750
- conn .commit ()
751
- return cur .fetchone ()[0 ]
752
-
753
- except Exception as error :
754
- logger .error (error )
755
- return error
756
-
757
- finally :
758
- if cur is not None :
759
- cur .close ()
760
- if conn is not None :
761
- conn .close ()
762
-
763
-
764
699
def create_other_exception (form , sub_data ):
765
700
cur = None
766
701
conn = None
@@ -872,6 +807,7 @@ def create_threshold_exception(form, iteration, sub_data):
872
807
if conn is not None :
873
808
conn .close ()
874
809
810
+
875
811
def get_cdl_exceptions (file_type ):
876
812
cur = None
877
813
conn = None
@@ -908,80 +844,6 @@ def get_cdl_exceptions(file_type):
908
844
if conn is not None :
909
845
conn .close ()
910
846
911
- def get_submissions (user ):
912
- cur = None
913
- conn = None
914
- try :
915
- conn = psycopg .connect (
916
- host = APCD_DB ['host' ],
917
- dbname = APCD_DB ['database' ],
918
- user = APCD_DB ['user' ],
919
- password = APCD_DB ['password' ],
920
- port = APCD_DB ['port' ],
921
- sslmode = 'require'
922
- )
923
-
924
- query = """SELECT * FROM submissions
925
- WHERE submitter_id
926
- IN (
927
- SELECT submitter_users.submitter_id FROM submitter_users
928
- WHERE user_id = %s )
929
- """
930
-
931
- cur = conn .cursor ()
932
- cur .execute (query , (user ,))
933
- return cur .fetchall ()
934
-
935
- except Exception as error :
936
- logger .error (error )
937
-
938
- finally :
939
- if cur is not None :
940
- cur .close ()
941
- if conn is not None :
942
- conn .close ()
943
-
944
- def get_submission_logs (submission_id ):
945
-
946
- cur = None
947
- conn = None
948
- try :
949
- conn = psycopg .connect (
950
- host = APCD_DB ['host' ],
951
- dbname = APCD_DB ['database' ],
952
- user = APCD_DB ['user' ],
953
- password = APCD_DB ['password' ],
954
- port = APCD_DB ['port' ],
955
- sslmode = 'require'
956
- )
957
-
958
-
959
- query = """SELECT
960
- submission_logs.log_id,
961
- submission_logs.submission_id,
962
- submission_logs.file_type,
963
- submission_logs.validation_suite,
964
- submission_logs.json_log,
965
- submission_logs.outcome,
966
- standard_codes.item_value
967
- FROM submission_logs
968
- LEFT JOIN standard_codes
969
- ON UPPER(submission_logs.file_type) = UPPER(standard_codes.item_code) AND list_name='submission_file_type'
970
- WHERE submission_id= (%s)
971
- """
972
-
973
- cur = conn .cursor ()
974
- cur .execute (query , (submission_id ,))
975
- return cur .fetchall ()
976
-
977
- except Exception as error :
978
- logger .error (error )
979
-
980
- finally :
981
- if cur is not None :
982
- cur .close ()
983
- if conn is not None :
984
- conn .close ()
985
847
986
848
def get_user_submissions_and_logs (user ):
987
849
cur = None
0 commit comments