feat: add separate allow_public_comments field for bots#4588
feat: add separate allow_public_comments field for bots#4588SylvainChevalier wants to merge 4 commits intomainfrom
Conversation
Add a new `allow_public_comments` boolean field to the User model, separate from `is_primary_bot` which is used for scoring. This gives admins fine-grained control over which bots can post public comments without affecting scoring behavior. - New field defaults to False (bots can only post private comments) - Informative error message when bots try to post public comments - Admin UI updated to expose the new field - DB constraint ensures only bot accounts can have the flag set Closes #4583 Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Preview EnvironmentYour preview environment is ready!
Details
ℹ️ Preview Environment InfoIsolation:
Limitations:
Cleanup:
|
|
@claude let's make the field allow_public_comments_if_bot so it's clear it doesn't apply to humans. Unless you have a better name idea? |
|
Claude finished @SylvainChevalier's task in 1m 40s —— View job Renamed
|
Make the field name self-documenting: it only applies to bot accounts. Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
|
@claude please fix the unit test problems. |
|
Claude finished @SylvainChevalier's task in 5m 55s —— View job Fixing Unit Test Problems
The CI had two failures in Backend Checks:
Both are now fixed in commit |
- Fix line-too-long in users/admin.py (BotInline fields list) - Fix line-too-long in users/models.py (constraint check expression) - Add migration 0020 for is_primary_bot help_text change Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
|
@claude please fix the unit test problems. |
|
Claude encountered an error —— View job Fixing Unit Test Problems
|
|
@claude Resume |
|
Claude finished @hlbmtc's task in 2m 35s —— View job Fixed CI:
|
The help_text in the model used a Unicode right-single-quotation-mark (U+2019), while migration 0020 used a regular ASCII apostrophe. Django's makemigrations detected this mismatch and demanded a new migration. Aligning the model with the migration resolves the "Check migrations" CI failure. Co-authored-by: Hlib <hlbmtc@users.noreply.github.com>

Add a new
allow_public_commentsboolean field to the User model, separate fromis_primary_botwhich is used for scoring. This gives admins fine-grained control over which bots can post public comments without affecting scoring behavior.Closes #4583