Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion backend/donations/management/commands/generate_orgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,11 @@ def add_arguments(self, parser):
action="store_true",
help="Generate only valid, active organizations",
)
parser.add_argument(
"--ngohub",
action="store_true",
help="Also generate organizations which have an NGO Hub id",
)
parser.add_argument(
"--user_only",
action="store_true",
Expand Down Expand Up @@ -795,6 +800,7 @@ def handle(self, *args, **options):
total_organizations = options["total_orgs"]
create_valid = options.get("valid", None)
create_user_only = options.get("user_only", None)
create_ngohub_id = options.get("ngohub", None)

organizations: list[dict[str, Any]] = []
generated_organization_names: list[str] = []
Expand Down Expand Up @@ -859,7 +865,7 @@ def handle(self, *args, **options):
"website": fake.url(),
"is_active": create_valid or random.choice([True, False]),
"has_online_tax_account": create_valid or random.choice([True, False]),
"ngohub_org_id": random.choice([random.randint(1, 9999), None]),
"ngohub_org_id": random.choice([random.randint(1, 9999), None]) if create_ngohub_id else None,
}
try:
org = Ngo.objects.create(**organization_details)
Expand Down
2 changes: 1 addition & 1 deletion backend/utils/staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def reset_staging(generate_orgs_count=0, generate_causes_count=0, generate_donat
logger.info("Deleted all users except the default admins")

# Generate new demo organizations
management.call_command("generate_orgs", generate_orgs_count)
management.call_command("generate_orgs", generate_orgs_count, valid=True, ngohub=False)
logger.info("Generated %d demo organizations", generate_orgs_count)

# Generate new demo causes
Expand Down