Exemplo n.º 1
0
    def accept_users(self, request, queryset):
        rows_updated = queryset.update(status=REQUEST_STATUS_ACCEPTED)
        self.message_user(
            request, "%s developer%s successfully marked as accepted." % (rows_updated, (rows_updated > 1 and 's' or '')))

        # Send developer accepted emails manually, queryset updates do not invoke the 'post_save' signal
        for developer in queryset:
            send_developer_accepted_email.delay(developer.id)
Exemplo n.º 2
0
def activity_handler_developer_application(sender, instance, created,
                                           **kwargs):
    if created:
        send_new_developer_email.delay(instance.id)

        send_developer_application_received_email.delay(instance.id)
    else:
        if instance.status == REQUEST_STATUS_ACCEPTED and not instance.confirmation_sent_at:
            send_developer_accepted_email.delay(instance.id)