tcms.signals module

Defines custom signals sent throughout Kiwi TCMS. You can connect your own handlers if you’d like to augment some of the default behavior!

If you simply want to connect a signal handler add the following code to your local_settings.py:

from tcms.signals import *

USER_REGISTERED_SIGNAL.connect(notify_admins)

In case you want to perform more complex signal handling we advise you to create a new Django app and connect your handler function(s) to the desired signals inside the AppConfig.ready method. When you are done connect your Django app to the rest of Kiwi TCMS by altering the following setting:

INSTALLED_APPS += ['my_custom_app']
tcms.signals.USER_REGISTERED_SIGNAL = <django.dispatch.dispatcher.Signal object>

Sent when a new user is registered into Kiwi TCMS. This signal receives two keyword parameters: request and user respectively!

tcms.signals.handle_attachments_post_save(sender, instance, created=False, **kwargs)[source]

SimpleMDE image/file buttons will upload attachments under the currently logged-in user. This signal handler will re-attach these files under the document which is being saved!

tcms.signals.handle_attachments_pre_delete(sender, **kwargs)[source]

Delete files attached to object which is about to be deleted b/c django-attachments’ object_id is not a FK relationship and we can’t rely on cascading delete!

tcms.signals.handle_comments_pre_delete(sender, **kwargs)[source]

Delete comments attached to object which is about to be deleted b/c django-comments’ object_pk is not a FK relationship and we can’t rely on cascading delete!

tcms.signals.handle_emails_post_bug_save(sender, instance, created=False, **kwargs)[source]
tcms.signals.handle_emails_post_case_save(sender, instance, created=False, **kwargs)[source]

Send email updates after a TestCase has been updated!

tcms.signals.handle_emails_post_plan_save(sender, instance, created=False, **kwargs)[source]

Send email updates after a TestPlan has been updated!

tcms.signals.handle_emails_post_run_save(sender, *_args, **kwargs)[source]

Send email updates after a TestRus has been created or updated!

tcms.signals.handle_emails_pre_case_delete(sender, **kwargs)[source]

Send email updates before a TestCase will be deleted!

tcms.signals.notify_admins(sender, **kwargs)[source]

Very simple signal handler which sends emails to site admins when a new user has been registered!

Warning

This handler isn’t connected to the USER_REGISTERED_SIGNAL by default!

tcms.signals.pre_save_clean(sender, **kwargs)[source]