예제 #1
0
파일: models.py 프로젝트: zctyhj/kitsune
def connector(sender, instance, created, **kw):
    # Only email new announcements in a group. We don't want to email everyone.
    if created and instance.group:
        from kitsune.announcements.tasks import send_group_email
        now = datetime.now()
        if instance.is_visible():
            send_group_email.delay(instance.pk)
        elif now < instance.show_after:
            send_group_email.delay(instance.pk, eta=instance.show_after)
예제 #2
0
파일: models.py 프로젝트: 1234-/kitsune
def connector(sender, instance, created, **kw):
    # Only email new announcements in a group. We don't want to email everyone.
    if created and instance.group:
        from kitsune.announcements.tasks import send_group_email
        now = datetime.now()
        if instance.is_visible():
            send_group_email.delay(instance.pk)
        elif now < instance.show_after:
            send_group_email.delay(instance.pk, eta=instance.show_after)