Skip to content

Commit

Permalink
export and mail (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
mainlyIt authored Oct 28, 2024
1 parent b1f561c commit a724a11
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vespadb/observations/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def send_email_view(self, request: HttpRequest) -> HttpResponse:
fail_list.append(observation.id)
continue
try:
send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [observation.observer_email])
send_mail(subject, message, from_email=settings.DEFAULT_FROM_EMAIL,recipient_list=[observation.observer_email])
logger.debug(f"Email sent to {observation.observer_email} for observation {observation.id}")
observation.observer_received_email = True
observation.save()
Expand Down
2 changes: 1 addition & 1 deletion vespadb/observations/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ def export(self, request: Request) -> Response:
serialized_data = []
errors = []

for obj in queryset.iterator(chunk_size=1000):
for obj in queryset.iterator(chunk_size=100):
try:
serialized_obj = self.get_serializer(obj).data
serialized_data.append(serialized_obj)
Expand Down
1 change: 1 addition & 0 deletions vespadb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,4 @@
AWS_SES_REGION_NAME = "eu-west-1"
AWS_SES_REGION_ENDPOINT = "email.eu-west-1.amazonaws.com"
DEFAULT_FROM_EMAIL = secrets["DEFAULT_FROM_EMAIL"]
SERVER_EMAIL = secrets["DEFAULT_FROM_EMAIL"]

0 comments on commit a724a11

Please sign in to comment.