Skip to content

Instantly share code, notes, and snippets.

@gilsonbp
Created November 6, 2020 19:12
Show Gist options
  • Save gilsonbp/4e1cca9e0e4e263099399939470cbfbe to your computer and use it in GitHub Desktop.
Save gilsonbp/4e1cca9e0e4e263099399939470cbfbe to your computer and use it in GitHub Desktop.
Atualiza o campo notification_channel com um canal do Slack para enviar as notificações
# Seleciona as filas que deseja alterar:
queues = SQSQueue.objects.filter(
name__in=["dead__products_api__seller_product_moderation__approved", "products_api__seller_product_moderation__approved"]
)
# Faz um loop na lista atualizando o campo notification_channel
for queue in queues:
if not queue.notification_channel: # Verifica se a fila já não tem um outro canal do slack
queue.notification_channel = "tech-alerts-queues-catalog"
queue.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment