Skip to content

Commit 87520f7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 7140f51 commit 87520f7

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

sde_collections/models/collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ def count_delta_urls(self):
649649
def count_marked_for_deletion_urls(self):
650650
"""Return the count of Delta URLs marked for deletion."""
651651
return DeltaUrl.objects.filter(collection=self, to_delete=True).count()
652-
652+
653653
def save(self, *args, **kwargs):
654654
# Call the function to generate the value for the generated_field based on the original_field
655655
if not self.config_folder:

sde_collections/tasks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import json
22
import os
33
import shutil
4+
45
import boto3
56
from django.apps import apps
67
from django.conf import settings
78
from django.core import management
89
from django.core.management.commands import loaddata
910
from django.db import transaction
10-
from sde_collections.utils import slack_utils
11+
1112
from config import celery_app
1213
from sde_collections.models.collection_choice_fields import (
1314
ReindexingStatusChoices,
1415
WorkflowStatusChoices,
1516
)
17+
from sde_collections.utils import slack_utils
1618

1719
from .models.delta_url import DumpUrl
1820
from .sinequa_api import Api

sde_collections/utils/slack_utils.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,23 @@ def format_slack_message(name, details, collection_id):
5858
return slack_mentions + " " + message_template.format(name=linked_name)
5959
return message_template.format(name=linked_name)
6060

61-
def send_detailed_import_notification(collection_name, total_processed, curated_count, dump_count, delta_count, deletion_count):
62-
message = (f"'{collection_name}' brought into COSMOS. "
63-
f"Prior Curated: {curated_count}, URL counts - [Server: {total_processed}, "
64-
f"Dump: {dump_count}, New Deltas: {delta_count}, Deleted: {deletion_count}]")
61+
62+
def send_detailed_import_notification(
63+
collection_name, total_processed, curated_count, dump_count, delta_count, deletion_count
64+
):
65+
message = (
66+
f"'{collection_name}' brought into COSMOS. "
67+
f"Prior Curated: {curated_count}, URL counts - [Server: {total_processed}, "
68+
f"Dump: {dump_count}, New Deltas: {delta_count}, Deleted: {deletion_count}]"
69+
)
6570

6671
webhook_url = settings.SLACK_WEBHOOK_URL
6772
payload = {"text": message}
6873
response = requests.post(webhook_url, json=payload)
6974
if response.status_code != 200:
7075
print(f"Error sending Slack message: {response.text}")
7176

77+
7278
def send_slack_message(message):
7379
webhook_url = settings.SLACK_WEBHOOK_URL
7480
payload = {"text": message}

0 commit comments

Comments
 (0)