ref(web): remove unused form field classes from sentry.web.forms.fields#108326
Merged
ref(web): remove unused form field classes from sentry.web.forms.fields#108326
Conversation
Remove ReadOnlyTextWidget, ReadOnlyTextField, and UserField. They are not referenced anywhere in the codebase. UserField was last used in web/forms/teams.py (NewAccessGroupMemberForm), which was deleted in commit 8d0505a (June 2015, 'Remove usage of AccessGroup'). Co-authored-by: Cursor <cursoragent@cursor.com>
vgrozdanic
approved these changes
Feb 17, 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.
Summary
Remove dead code from
sentry.web.forms.fields:ReadOnlyTextWidget,ReadOnlyTextField, andUserField.Why these are safe to delete
ReadOnlyTextWidget and ReadOnlyTextField: Added in commit c5f224a (Aug 2014, "Implement managed users feature") for read-only fields on managed users. Last used in
AccountSettingsForminweb/forms/accounts.py(managed users' username/email/name). That usage was removed in commit 90d1d24 (Jul 14, 2020, "chore(frontend): Remove unused django forms" chore(frontend): Remove unused django forms #19873). The adminChangeUserFormusage was removed in a031b32 (Jul 2019) when the user edit page was converted to React. No references remain in Sentry or getsentry.UserField (Django form field): Last used in
web/forms/teams.pyinNewAccessGroupMemberForm(user = UserField()). That file was removed in commit 8d0505a (Jun 3, 2015, "Remove usage of AccessGroup"), so this field has been unused for ~10 years.The
UserFieldthat remains in use is the DRF serializer insentry.api.fields.user(e.g. release owner field); it is unchanged.