43697 backend [ Command panel ] Error 500 when deleting an account or user#175
Merged
pneumojoseph merged 8 commits intoMar 18, 2026
Merged
Conversation
…pty notifications
pneumojoseph
previously approved these changes
Mar 17, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Maria-Lordwill
previously approved these changes
Mar 18, 2026
…__error_when_deleting_user
8fc34b6
pneumojoseph
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

1. Description (problem)
text=None(NULL) in the database caused a crash when Django Admin prepared the deletion confirmation page (likely during string representation of related objects)./admin/) on the deletion confirmation pages for accounts and users.2. Context
3. Solution
Notification.textfield to includedefault=''and removednull=True. The field is now strictly a string at both the database and model levels.text=None.4. Implementation Details
5. What to Test
5.1 Preconditions
5.2 Positive Scenarios
text=''(empty string).5.3 Negative Scenarios and Edge Cases
5.4 Verification Points
NULLvalue in the [text] field.TypeErroror similar errors when opening Admin deletion pages.5.6 What Was NOT Tested
6. Testing Affected Areas
8. Commits
fix(accounts): prevent 500 error on delete account/user with empty notifications9. Release notes:
Note
Medium Risk
Includes a data migration that updates existing
accounts_notification.textNULLs and changes the model field semantics fromNoneto'', which may affect any code paths that relied on NULL/None checks.Overview
Prevents Django Admin 500s during account/user deletion by making
Notification.textconsistently a string: a new migration backfills existing NULLaccounts_notification.textvalues to''and alters the field todefault=''(removingnull=True).Updates urgent-notification task tests to assert
text=''instead ofNonewhen querying/validating created notifications.Written by Cursor Bugbot for commit 8fc34b6. This will update automatically on new commits. Configure here.
Note
Fix Error 500 when deleting an account or user by making
Notification.textnon-nullableChanges the
textfield on theNotificationmodel fromnull=Truetodefault=''to prevent null values that caused 500 errors during account/user deletion. A database migration updates existingNULLrows to empty strings before altering the column. Tests are updated to asserttext=''instead oftext=None.Macroscope summarized 8fc34b6.