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

kobotoolbox / kpi / 24652083072
82%
master: 76%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/actions-deps-742e3c8d1b
DEFAULT BRANCH: master
Ran 20 Apr 2026 06:40AM UTC
Jobs 10
Files 910
Run time 2min
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: 82.208%. Remained the same
24652083072

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

7781 of 11965 branches covered (65.03%)

29612 of 36021 relevant lines covered (82.21%)

5.79 hits per line

Coverage Regressions

Lines Coverage ∆ File
64
69.75
-17.93% kpi/views/v2/asset.py
63
34.55
-57.27% kpi/views/v2/paired_data.py
58
59.93
-19.53% kpi/views/v2/data.py
32
50.75
-47.76% kpi/views/v2/asset_export_settings.py
29
63.16
-30.53% kpi/views/v2/asset_permission_assignment.py
27
45.16
-43.55% kpi/views/v2/attachment.py
25
55.56
-18.52% kpi/views/v2/asset_snapshot.py
19
51.06
-40.43% kpi/views/v2/import_task.py
18
66.04
-33.96% kpi/views/v2/export_task.py
7
74.07
-25.93% kpi/views/v2/attachment_delete.py
7
75.86
-24.14% kpi/views/v2/tag.py
5
76.0
-20.0% kpi/views/v2/asset_counts.py
5
61.54
-38.46% kpi/views/v2/logout.py
3
86.67
-10.0% kpi/views/v2/asset_version.py
3
75.0
-25.0% kpi/views/v2/open_rosa.py
2
88.24
-11.76% kpi/views/v2/service_usage.py
1
93.33
-6.67% kpi/views/v2/asset_usage.py
Jobs
ID Job ID Ran Files Coverage
1 24652083072.1 20 Apr 2026 06:40AM UTC 906
52.78
2 24652083072.2 20 Apr 2026 06:40AM UTC 906
54.32
3 24652083072.3 20 Apr 2026 06:41AM UTC 908
54.01
4 24652083072.4 20 Apr 2026 06:41AM UTC 908
55.57
5 24652083072.5 20 Apr 2026 06:42AM UTC 906
53.02
6 24652083072.6 20 Apr 2026 06:42AM UTC 906
60.36
7 24652083072.7 20 Apr 2026 06:42AM UTC 908
66.04
8 24652083072.8 20 Apr 2026 06:44AM UTC 908
61.49
9 24652083072.9 20 Apr 2026 06:44AM UTC 910
68.28
10 24652083072.10 20 Apr 2026 06:45AM UTC 908
54.37
Source Files on build 24652083072
  • Tree
  • List 910
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • a09b4b6a on github
  • Prev Build on release/2.026.12 (#24517776053)
  • Next Build on release/2.026.12 (#24654785901)
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