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

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

Build:
Build:
LAST BUILD BRANCH: dev-1494-execution-and-polling-for-bulk-actions
DEFAULT BRANCH: master
Ran 20 Apr 2026 06:41AM UTC
Files 908
Run time 30s
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: 55.565% (+2.5%) from 53.018%
24652083072.4

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."

3979 of 11828 branches covered (33.64%)

19969 of 35938 relevant lines covered (55.57%)

0.56 hits per line

Source Files on job 24652083072.4
  • Tree
  • List 908
  • Changed 213
  • Source Changed 0
  • Coverage Changed 213
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