from django.db import transaction

from agir.activity.models import Activity


@transaction.atomic()
def new_event_suggestion_notification(event, recipient):
    activity_config = {
        "type": Activity.TYPE_EVENT_SUGGESTION,
        "event": event,
        "status": Activity.STATUS_DISPLAYED,
    }
    if event.organizers_groups.count() > 0:
        activity_config["supportgroup"] = event.organizers_groups.first()
    else:
        activity_config["individual"] = event.organizers.first()

    Activity.objects.bulk_create(
        [Activity(**activity_config, recipient=recipient)], send_post_save_signal=True,
    )

@@ -517,13 +517,8 @@
 cts.
-bulk_
 crea
@@ -533,18 +533,8 @@
     
-%5BActivity(
 **ac
@@ -547,16 +547,24 @@
 _config,
+%0A       
  recipie
@@ -579,38 +579,8 @@
 ient
-)%5D, send_post_save_signal=True
 ,%0A  

use create instead of bulk_create when we create only one activity