Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Add missing bounce import to dummy data script.

Kailash Nadh753144c59517
diff --git a/scripts/populate-dummy.py b/scripts/populate-dummy.py
index f69a74e7..440ad104 100755
--- a/scripts/populate-dummy.py
+++ b/scripts/populate-dummy.py
@@ -19,8 +19,9 @@ NUM_USERS = 10
NUM_ROLES = 3
NUM_CLICKS = 10000
NUM_VIEWS = 10000
+NUM_BOUNCES = 100
-# Number of campaigns and links that clicks/views are spread across.
+# Number of campaigns and links that clicks/views/bounces are spread across.
SAMPLE_CAMPAIGNS = 10
SAMPLE_LINKS = 10
@@ -247,6 +248,14 @@ def main():
""", views)
print(f"{len(views)} campaign views")
+ bounces = [(random.choice(click_camps), random.choice(sub_ids),
+ random.choice(["soft", "hard", "complaint"]), "demo", rand_time(now))
+ for _ in range(NUM_BOUNCES)]
+ insert(cur, """
+ INSERT INTO bounces (campaign_id, subscriber_id, type, source, created_at) VALUES {}
+ """, bounces)
+ print(f"{len(bounces)} bounces")
+
db.commit()
cur.close()
db.close()