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

kobotoolbox / kpi / 27147750209
82%
master: 76%

Build:
Build:
LAST BUILD BRANCH: beccagraber/dev-2248-unable-to-delete-projects
DEFAULT BRANCH: master
Ran 08 Jun 2026 03:23PM UTC
Jobs 10
Files 914
Run time 3min
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

08 Jun 2026 03:18PM UTC coverage: 82.002% (+0.003%) from 81.999%
27147750209

push

github

web-flow
fix(accounts): avoid IntegrityError on SSO reconnect DEV-2226 (#7126)

### 📣 Summary

Reconnecting a social (SSO) account failed with a database error when
the user's email address was already stored.

### 💭 Notes

- The crash occurred in `update_email` (signal on
`social_account_added`) at `primary.set_as_primary()`, which called
`save()` on an unsaved `EmailAddress` instance — triggering an INSERT
that violated the `unique(user_id, email)` constraint.
- Fix: before calling `set_as_primary()`, if `primary.pk` is `None`, we
attempt `EmailAddress.objects.get(user=social_user,
email=primary.email)`. If the row already exists, we reuse that instance
(with its pk) so `save()` does an UPDATE instead of INSERT.
- The lookup is scoped to `user=social_user`, so two users sharing the
same email address cannot interfere with each other.
- Two new tests cover: (1) reconnecting SSO with an already-stored
email, (2) isolation between users who share an email.

9236 of 12472 branches covered (74.05%)

0 of 5 new or added lines in 1 file covered. (0.0%)

519 existing lines in 20 files now uncovered.

30503 of 37198 relevant lines covered (82.0%)

5.72 hits per line

Uncovered Changes

Lines Coverage ∆ File
5
26.92
-6.41% kobo/apps/accounts/signals.py

Coverage Regressions

Lines Coverage ∆ File
81
0.0
-93.1% kobo/apps/stripe/serializers.py
75
0.0
-41.9% kobo/apps/stripe/views.py
65
26.05
-54.62% kobo/apps/stripe/utils/subscription_limits.py
63
0.0
-51.64% kobo/apps/stripe/models.py
52
60.5
-26.0% kpi/utils/xml.py
44
20.21
-46.81% kobo/apps/stripe/utils/billing_dates.py
24
74.76
-23.3% kpi/utils/usage_calculator.py
21
0.0
-84.0% kobo/apps/stripe/signals.py
19
0.0
-65.52% kobo/apps/stripe/admin.py
14
31.82
-31.82% kobo/apps/stripe/utils/limit_enforcement.py
12
35.0
-60.0% kobo/apps/stripe/utils/import_management.py
10
30.12
-12.05% kpi/utils/storage.py
9
0.0
-29.03% kobo/apps/stripe/utils/manual_subscription.py
8
0.0
-100.0% kobo/apps/stripe/urls.py
7
0.0
-100.0% kobo/apps/stripe/apps.py
6
0.0
-100.0% kobo/apps/stripe/exceptions.py
6
0.0
-37.5% kobo/apps/stripe/utils/view_utils.py
1
26.92
-6.41% kobo/apps/accounts/signals.py
1
92.31
-7.69% kobo/apps/user_reports/utils/migrations.py
1
75.0
-4.17% kpi/urls/__init__.py
Jobs
ID Job ID Ran Files Coverage
1 27147750209.1 08 Jun 2026 03:23PM UTC 910
51.92
2 27147750209.2 08 Jun 2026 03:24PM UTC 910
53.56
3 27147750209.3 08 Jun 2026 03:25PM UTC 910
52.17
4 27147750209.4 08 Jun 2026 03:25PM UTC 912
54.82
5 27147750209.5 08 Jun 2026 03:25PM UTC 912
53.15
6 27147750209.6 08 Jun 2026 03:26PM UTC 910
59.39
7 27147750209.7 08 Jun 2026 03:26PM UTC 912
66.06
8 27147750209.8 08 Jun 2026 03:27PM UTC 912
53.52
9 27147750209.9 08 Jun 2026 03:27PM UTC 912
60.52
10 27147750209.10 08 Jun 2026 03:28PM UTC 914
68.36
Source Files on build 27147750209
  • Tree
  • List 914
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 48f4ead0 on github
  • Prev Build on release/2.026.21 (#27024834989)
  • Next Build on release/2.026.21 (#27186280883)
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