Fix price extraction bug and remove debugging statements
This commit is contained in:
@@ -67,6 +67,7 @@ def update_customer_fields(user):
|
||||
name = expand_name(user.first_name, user.last_name)
|
||||
stripe.Customer.modify(user.stripe_id, name=name)
|
||||
|
||||
|
||||
def create_or_update_customer(user):
|
||||
"""
|
||||
Create or update a customer in Lago.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
from django.conf import settings
|
||||
from elastic_transport import ConnectionError
|
||||
from elasticsearch import Elasticsearch
|
||||
|
||||
from core.util import logs
|
||||
@@ -27,6 +28,10 @@ def store_msg(index, msg):
|
||||
client = initialise_elasticsearch()
|
||||
if "ts" not in msg:
|
||||
msg["ts"] = datetime.utcnow().isoformat()
|
||||
result = client.index(index=index, body=msg)
|
||||
try:
|
||||
result = client.index(index=index, body=msg)
|
||||
except ConnectionError as e:
|
||||
log.error(f"Error indexing '{msg}': {e}")
|
||||
return
|
||||
if not result["result"] == "created":
|
||||
log.error(f"Indexing of '{msg}' failed: {result}")
|
||||
|
||||
Reference in New Issue
Block a user