from django.dispatch import receiver from django.conf import settings from pingcap_sso.discourse import signals as discourse_signals from pingcap_sso.tasks.asktug_tidb_usage import update_user_tidb_usage_by_asktug_qa_topic @receiver(discourse_signals.topic_created) def _update_user_tidb_usage_by_asktug_topic(sender, topic, **kwargs): if not (settings.DEBUG or settings.STAGING): update_user_tidb_usage_by_asktug_qa_topic.delay(topic['id'])