Fix str formatting

This commit is contained in:
PCoder 2019-12-26 08:06:27 +05:30
parent 0b8315ca76
commit ca128dd8c4

View file

@ -68,8 +68,8 @@ def handle_webhook(request):
if event.type == "customer.tax_id.updated": if event.type == "customer.tax_id.updated":
logger.debug("Webhook Event: customer.tax_id.updated") logger.debug("Webhook Event: customer.tax_id.updated")
tax_id_obj = event.data.object tax_id_obj = event.data.object
logger.debug("Tax_id %s is %s" % tax_id_obj.id, logger.debug("Tax_id %s is %s" % (tax_id_obj.id,
tax_id_obj.verification.status) tax_id_obj.verification.status))
if tax_id_obj.verification.status == "verified": if tax_id_obj.verification.status == "verified":
b_addresses = BillingAddress.objects.filter(vat_number=tax_id_obj.value) b_addresses = BillingAddress.objects.filter(vat_number=tax_id_obj.value)
for b_address in b_addresses: for b_address in b_addresses:
@ -79,8 +79,8 @@ def handle_webhook(request):
for ub_address in ub_addresses: for ub_address in ub_addresses:
ub_address.vat_number_validated_on = datetime.datetime.now() ub_address.vat_number_validated_on = datetime.datetime.now()
else: else:
logger.debug("Tax_id %s is %s" % tax_id_obj.id, logger.debug("Tax_id %s is %s" % (tax_id_obj.id,
tax_id_obj.verification.status) tax_id_obj.verification.status))
else: else:
logger.error("Unhandled event : " + event.type) logger.error("Unhandled event : " + event.type)
return HttpResponse(status=200) return HttpResponse(status=200)