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

kobotoolbox / kpi / 12775603531
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: beccagraber/dev-1452-new_action
DEFAULT BRANCH: master
Ran 14 Jan 2025 08:47PM UTC
Jobs 1
Files 623
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

14 Jan 2025 08:11PM UTC coverage: 80.494% (-0.005%) from 80.499%
12775603531

push

github

web-flow
fix(auditLogs): correctly serialize audit logs from deleted users (#5418)

### đŸ“Ŗ Summary
Fixes a 500 error from the various audit log endpoints when there are
actions by deleted users.



### 📖 Description
Return empty user and username fields in the response if the user was
deleted after the log was created. This applies to `/api/v2/audit-logs`,
`api/v2/assets/<uid>/history`, and `api/v2/project-history-logs`.


### 💭 Notes
Small fix in the serializer. Also updates the ProjectHistoryLog
serializer to inherit from the AuditLogSerializer so we don't have to
duplicate the method fields.



### 👀 Preview steps

Bug template:
1. â„šī¸ have a super user account and a project
2. Create a new user (user1) and give them the `Edit Form` permission on
the project.
3. Log in as user1 and make an edit to the project.
4. Log out user1 and log back in as the super user
5. Delete user1. You can do this from the admin page if you delete the
user from the User list, then from the Trash Bin.
6. Go to:
  a. `api/v2/audit-logs`
  b. `api/v2/project-history-logs`
  c. `api/v2/assets/<uid>/history`
7. 🔴 [on main] All will return a 500 error (`AttributeError: 'NoneType'
object has no attribute 'username'`)
8. đŸŸĸ [on PR] The endpoint will return the expected logs. For all user1's
actions, the user and username fields will be empty. but the user_uid
should still refer to the old user.

5811 of 9300 branches covered (62.48%)

2 of 2 new or added lines in 1 file covered. (100.0%)

22209 of 27591 relevant lines covered (80.49%)

0.8 hits per line

Jobs
ID Job ID Ran Files Coverage
1 12775603531.1 14 Jan 2025 08:47PM UTC 623
80.49
Source Files on build 12775603531
  • Tree
  • List 623
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 89bd9b79 on github
  • Prev Build on main (#12755097466)
  • Next Build on main (#12775758943)
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

© 2025 Coveralls, Inc