Skip to content

Commit 715a571

Browse files
committed
Merge branch '1051-backend-model-changes-on-cosmos-to-hold-new-incoming-urls-frontend' of https://github.com/NASA-IMPACT/COSMOS into 1051-backend-model-changes-on-cosmos-to-hold-new-incoming-urls-frontend
2 parents 7a02ec5 + 936bddc commit 715a571

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

sde_collections/models/collection.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,13 @@ def save(self, *args, **kwargs):
623623
if transition in STATUS_CHANGE_NOTIFICATIONS:
624624
details = STATUS_CHANGE_NOTIFICATIONS[transition]
625625
message = format_slack_message(self.name, details, self.id)
626-
send_slack_message(message)
626+
try:
627+
# TODO: find a better way to allow this to work on dev environments with
628+
# no slack integration
629+
send_slack_message(message)
630+
except Exception as e:
631+
print(f"Error sending Slack message: {e}")
632+
627633
# Call the parent class's save method
628634
super().save(*args, **kwargs)
629635

@@ -722,7 +728,9 @@ def create_configs_on_status_change(sender, instance, created, **kwargs):
722728
if instance.workflow_status == WorkflowStatusChoices.READY_FOR_CURATION:
723729
instance.create_plugin_config(overwrite=True)
724730
elif instance.workflow_status == WorkflowStatusChoices.CURATED:
731+
print(instance.workflow_status)
725732
instance.promote_to_curated()
733+
print(instance.workflow_status)
726734
elif instance.workflow_status == WorkflowStatusChoices.READY_FOR_ENGINEERING:
727735
instance.create_scraper_config(overwrite=False)
728736
instance.create_indexer_config(overwrite=False)

0 commit comments

Comments
 (0)