Conversation
…ocale options, and update frontend dependencies.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe pull request enhances the seed data command with currency and country customization options, updates frontend dependencies with incremental version bumps, adjusts Svelte and Vite configuration for improved bundling, and adds a demonstration video link to the README. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR enhances the Django seed_data management command to support specifying organization currency/country (and aligning Faker locale accordingly), and updates the SvelteKit frontend build configuration/dependencies (notably Sentry/SvelteKit-related tooling).
Changes:
- Add
--currency/--countryoptions toseed_dataand use them when creating orgs and address-related records. - Initialize Faker using a locale derived from the provided country code.
- Update frontend dependencies/lockfile and adjust Svelte/Vite config related to dependency prebundling.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/vite.config.js | Removes optimizeDeps.exclude for esm-env while keeping Sentry/Tailwind/SvelteKit Vite plugin setup. |
| frontend/svelte.config.js | Disables prebundling of Svelte libraries via vitePlugin.prebundleSvelteLibraries. |
| frontend/package.json | Bumps SvelteKit/Sentry/Axios/etc. versions. |
| frontend/pnpm-lock.yaml | Updates dependency graph to match the bumped frontend packages (including new transitive deps). |
| backend/common/management/commands/seed_data.py | Adds currency/country CLI options, sets Faker locale from country, and uses org defaults for country/currency in seeded records. |
| README.md | Adds a demo video link. |
Files not reviewed (1)
- frontend/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def handle(self, *args, **options): | ||
| # Initialize Faker | ||
| # Initialize Faker with locale matching the country | ||
| country = options["country"].upper() |
There was a problem hiding this comment.
country is normalized to uppercase for locale selection, but the normalized value isn’t persisted back into options. Later seed_all() passes options["country"] into create_org(), so org/default_country (and downstream Contact/Account/Lead countries) can end up lowercased or otherwise different from what’s logged. Consider normalizing once (e.g., overwrite options["country"] with the uppercased value) and consistently pass/store the normalized country code.
| country = options["country"].upper() | |
| country = options["country"].upper() | |
| options["country"] = country |
| seed = options.get("seed") | ||
| if seed: | ||
| random.seed(seed) | ||
| self.fake = Faker(["en_US"]) | ||
| self.fake = Faker([locale]) | ||
| Faker.seed(seed) | ||
| else: | ||
| self.fake = Faker(["en_US", "en_GB", "en_CA", "en_AU"]) | ||
| self.fake = Faker([locale]) |
There was a problem hiding this comment.
if seed: treats 0 as “no seed”, so --seed 0 won’t actually seed random/Faker and will produce non-deterministic results. Use an explicit None check (e.g., if seed is not None:) so all integer seeds work.
| parser.add_argument( | ||
| "--country", | ||
| type=str, | ||
| default="US", | ||
| help="Default country code for organizations (default: US). Examples: US, GB, CA, AU, DE, FR, IN", | ||
| ) |
There was a problem hiding this comment.
--country accepts any string, but Org.default_country is a CharField(max_length=2, choices=COUNTRIES). Passing a value longer than 2 characters (or not in the allowed choices) will raise a DB error during Org.objects.create(...) or create inconsistent seed data. Consider constraining the argument (choices and/or length validation) and normalizing to uppercase at parse-time.
…ocale options, and update frontend dependencies.
Summary by CodeRabbit
Release Notes
Documentation
New Features
Chores