Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions ledgergw/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,12 @@ def update_user_info_id(request, userid,apikey):
if ledger_obj.postal_address.country != postal_address_obj['postal_country']:
models.EmailUserChangeLog.objects.create(emailuser=ledger_user[0], change_key="postal_country", change_value="ledger_api_client_"+api_key_obj_update_key+": " +ledgergw_utils.remove_html_tags(postal_address_obj['postal_country']),change_by=ledger_changeuser_obj)
ledger_obj.postal_address.country = ledgergw_utils.remove_html_tags(postal_address_obj['postal_country'])

if 'postal_same_as_residential' in postal_address_obj:
if ledger_obj.postal_same_as_residential != postal_address_obj['postal_same_as_residential']:
models.EmailUserChangeLog.objects.create(emailuser=ledger_user[0], change_key="postal_same_as_residential", change_value="ledger_api_client_"+api_key_obj_update_key+": " +str(postal_address_obj['postal_same_as_residential']),change_by=ledger_changeuser_obj)
if isinstance(postal_address_obj['postal_same_as_residential'], bool):
ledger_obj.postal_same_as_residential = postal_address_obj['postal_same_as_residential']
if 'postal_same_as_residential' in postal_address_obj:
if ledger_obj.postal_same_as_residential != postal_address_obj['postal_same_as_residential']:
models.EmailUserChangeLog.objects.create(emailuser=ledger_user[0], change_key="postal_same_as_residential", change_value="ledger_api_client_"+api_key_obj_update_key+": " +str(postal_address_obj['postal_same_as_residential']),change_by=ledger_changeuser_obj)
if isinstance(postal_address_obj['postal_same_as_residential'], bool):
ledger_obj.postal_same_as_residential = postal_address_obj['postal_same_as_residential']

ledger_obj.postal_address.save()
except Exception as e:
print (str(e))
Expand Down Expand Up @@ -2514,4 +2514,4 @@ def check_oracle_code(request,apikey):
# print(traceback.print_exc())
# raise



4 changes: 2 additions & 2 deletions ledgergw/management/commands/cba_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def handle(self, *args, **options):
print ("removing "+lbf)
os.remove(local_bank_directory+lbf)

result = subprocess.check_output('echo "ls '+remote_bank_directory+'" | sftp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i /tmp/bank.key '+sftp_username+'@'+sftp_host, shell=True, text=True)
result = subprocess.check_output('echo "ls '+remote_bank_directory+'" | sftp -o Ciphers=aes256-ctr -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i /tmp/bank.key '+sftp_username+'@'+sftp_host, shell=True, text=True)
sftpfiles = result.split("\n")
for file in sftpfiles:
sftp_file = file.strip()
Expand All @@ -53,7 +53,7 @@ def handle(self, *args, **options):
print ("File already exists not downloading "+file_only)
else:
print ('downloading file '+file_only)
get_resp = subprocess.check_output('echo "get '+sftp_file+' '+local_bank_directory+'" | sftp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i /tmp/bank.key '+sftp_username+'@'+sftp_host, shell=True, text=True)
get_resp = subprocess.check_output('echo "get '+sftp_file+' '+local_bank_directory+'" | sftp -o Ciphers=aes256-ctr -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i /tmp/bank.key '+sftp_username+'@'+sftp_host, shell=True, text=True)
#print (get_resp)
os.remove('/tmp/bank.key')
except Exception as e:
Expand Down
Loading