Skip to content

Commit

Permalink
move prod only module import
Browse files Browse the repository at this point in the history
  • Loading branch information
sravfeyn committed Sep 13, 2024
1 parent a753311 commit dac5557
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commcare_connect/events/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import django_tables2 as tables
import sentry_sdk
from dal.autocomplete import ModelSelect2
from django.db import transaction
from django.utils.decorators import method_decorator
Expand Down Expand Up @@ -52,6 +51,8 @@ def create(self, request, *args, **kwargs):
event_objects = [Event(**item) for item in serializer.validated_data]
Event.objects.bulk_create(event_objects)
except Exception as e:
import sentry_sdk

sentry_sdk.capture_exception(e)
# Bulk create failed, try saving each item individually
failed_items = []
Expand Down

0 comments on commit dac5557

Please sign in to comment.