Skip to content

Comments

Hide suggestion upvoters in admin to prevent accidental overwrite (T3…#1511

Merged
suecarmol merged 3 commits intoWikipediaLibrary:masterfrom
Stitipragyanbarik:hide-upvoters-admin
Feb 14, 2026
Merged

Hide suggestion upvoters in admin to prevent accidental overwrite (T3…#1511
suecarmol merged 3 commits intoWikipediaLibrary:masterfrom
Stitipragyanbarik:hide-upvoters-admin

Conversation

@Stitipragyanbarik
Copy link
Contributor

@Stitipragyanbarik Stitipragyanbarik commented Feb 10, 2026

…75172)

Description

This PR hides the upvoted_users field from the Django admin interface
for Suggestions.

The admin edit form previously exposed a multi-select widget for
upvoters, which could accidentally overwrite existing upvotes when
admins edited unrelated fields such as Phabricator task IDs.

Describe your changes in detail following the commit message guidelines

Rationale

The upvoter list is not intended to be edited manually by administrators.
Exposing it in the admin UI makes it easy to accidentally clear or reduce
upvotes when saving the form.

Hiding this field prevents unintended data loss and improves admin safety.

Phabricator Ticket

https://phabricator.wikimedia.org/T375172

How Has This Been Tested?

  • Manually tested via Django admin.
  • Edited a suggestion in /admin without modifying upvotes.
  • Confirmed that the upvoter list is no longer shown and existing upvotes
    remain unchanged after saving.

Screenshots of your changes (if appropriate):

image

image

Types of changes

What types of changes does your code introduce? Add an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Minor change (fix a typo, add a translation tag, add section to README, etc.)

@Stitipragyanbarik
Copy link
Contributor Author

@Samwalton9 is it solve the issue?

@Samwalton9
Copy link
Member

Could you share a screenshot of your changes locally, showing this having the intended effect, please?

@Stitipragyanbarik
Copy link
Contributor Author

@Samwalton9 can you check now?

@Samwalton9
Copy link
Member

That's great, thank you :)

@Stitipragyanbarik
Copy link
Contributor Author

Thanks for the confirmation!
Please let me know if there’s anything else you’d like me to adjust.

@suecarmol
Copy link
Contributor

Thank you for your PR! A formatting test is failing. Can you run docker-compose exec twlight /venv/bin/black -t py311 /app/TWLight and upload your changes?

@Stitipragyanbarik
Copy link
Contributor Author

@suecarmol check once

Copy link
Contributor

@suecarmol suecarmol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making these changes!

@suecarmol suecarmol merged commit 8aec9cf into WikipediaLibrary:master Feb 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants