Flagsmith / Flagsmith/flagsmith
Allow to omit traits and environment API keys in `dumporganisationdatatolocalfs`
Open
api
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 567
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 121
Description
**Symptom:** `loaddata` raises `IntegrityError` when the target database already contains the same trait or API key.
**Root cause:** Both models define `natural_key()` (used during serialisation) but their managers lack `get_by_natural_key()` (needed during deserialisation). Without it, `loaddata` always attempts an INSERT rather than an UPDATE, hitting unique constraints.
**Fix:** To `dumporganisationdatatolocalfs` CLI management command, add an option to omit traits and environment keys entirely — these updates are not expected to be needed for the air-gapped env use case.
Contributor guide
Assessment
This issue has not been assessed yet.