• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kobotoolbox / kpi / 24652083072 / 9
82%
master: 76%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 20 Apr 2026 06:44AM UTC
Files 910
Run time 22s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Apr 2026 06:35AM UTC coverage: 68.282% (+15.3%) from 53.018%
24652083072.9

push

github

web-flow
fix: prevent IntegrityError when running `create_kobo_superuser` management command DEV-1987 (#6945)

### 📣 Summary

Running `create_kobo_superuser` could crash with an `IntegrityError`
when trying to create the user profile.

### 💭 Notes

- `UserProfile.objects.create` and `EmailAddress.create` replaced with
`get_or_create` to avoid `IntegrityError` on duplicate records.
- Secondary fix: when `ProgrammingError` is raised inside
`create_superuser` (KC DB not ready, signal-level failure), the `user`
variable was never assigned, causing a `NameError` on the subsequent
`EmailAddress.objects.get_or_create(user=user, ...)` call. Fix: retrieve
the already-saved user via `User.objects.get(username=super_username)`.
- Three unit tests added: happy path, `ProgrammingError` recovery
(mocked), and early-exit when user already exists.

### Preview steps:
1. from release branch, run `KOBO_SUPERUSER_USERNAME=foobar ./manage.py
create_kobo_superuser` and receive an IntegrityError
2. from this branch, receive the message "Superuser xxx successfully
created."

5598 of 11950 branches covered (46.85%)

24596 of 36021 relevant lines covered (68.28%)

0.68 hits per line

Source Files on job 24652083072.9
  • Tree
  • List 910
  • Changed 330
  • Source Changed 0
  • Coverage Changed 330
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 24652083072
  • a09b4b6a on github
  • Prev Job for on release/2.026.12 (#24517776053.7)
  • Next Job for on release/2.026.12 (#24654785901.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc