Flagsmith / Flagsmith/flagsmith

Allow to omit traits and environment API keys in `dumporganisationdatatolocalfs`

Open
#6,769 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.