Skip to content

Conversation

@palcu
Copy link

@palcu palcu commented Dec 24, 2025

Summary

  • When sending "Significant change" (CP change) emails, skip users who have withdrawn their predictions from ALL questions in a post
  • If a user still has at least one active forecast on any question in the post, they will continue receiving CP change emails

Changes

  • Add helper function get_users_with_active_forecasts_for_questions() that returns user IDs with at least one active forecast (where end_time is NULL or in the future)
  • Modify notify_post_cp_change() to skip users without active forecasts
  • Add tests for the new functionality

Test plan

  • Added unit tests for get_users_with_active_forecasts_for_questions()
    • Users with active forecasts (end_time=None) are included
    • Users with withdrawn forecasts (end_time in past) are excluded
    • Users with future end_time are still considered active
    • Users with at least one active forecast across multiple questions are included

🤖 Generated with Claude Code

When sending "Significant change" (CP change) emails, skip users who
have withdrawn their predictions from ALL questions in a post.

- Add helper function get_users_with_active_forecasts_for_questions()
  that returns user IDs with at least one active forecast
- Modify notify_post_cp_change() to skip users without active forecasts
- Add tests for the new functionality

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@palcu palcu force-pushed the skip-cp-change-emails-for-withdrawn-forecasts branch from dd1dd83 to 108e616 Compare December 24, 2025 14:00
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.

1 participant