diff --git a/management/commands/import_activities.py b/management/commands/import_activities.py index d43a80c..d3ffd99 100644 --- a/management/commands/import_activities.py +++ b/management/commands/import_activities.py @@ -40,7 +40,8 @@ class Command(ImportCommand): cur.execute("SELECT * FROM activites ORDER by id") n = cur.rowcount bulk_mgr = BulkCreateManager(chunk_size=chunk) - activity_type_id = ActivityType.objects.get(name="Pot").pk # Need to be fixed manually + pot_id = ActivityType.objects.get(name="Pot").pk + club_id = ActivityType.objects.get(name="Soirée de club").pk kfet = Club.objects.get(name="Kfet") pk_activity = 1 for idx, row in enumerate(cur): @@ -64,7 +65,7 @@ class Command(ImportCommand): "name": row["titre"], "description": row["description"], "location": row["lieu"], - "activity_type_id": activity_type_id, # By default Pot + "activity_type_id": pot_id if row["liste"] else club_id, "creater_id": NoteUser.objects.get(pk=note).user.id, "organizer_id": organizer.pk, "attendees_club_id": kfet.pk, # Maybe fix manually