Skip to content

Commit

Permalink
Merge pull request #2970 from vorasmit/pass-decryption
Browse files Browse the repository at this point in the history
  • Loading branch information
vorasmit authored Jan 15, 2025
2 parents 3ba89e7 + 7e8d515 commit af284b1
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import click

import frappe
from frappe import _
from frappe.utils import sbool
from frappe.utils.password import decrypt

Expand Down Expand Up @@ -63,7 +64,18 @@ def get_credentials_from_e_invoice_user():
)

for credential in old_credentials:
credential.password = credential.password and decrypt(credential.password)
try:
password = credential.password and decrypt(credential.password)
except Exception as e:
password = None
frappe.log_error(
title=_(
"Failed to decrypt password for E Invoice User {0} - {1}"
).format(credential.company, credential.gstin),
message=e,
)

credential.password = password
credential.service = "e-Waybill / e-Invoice"

return old_credentials

0 comments on commit af284b1

Please sign in to comment.