-
Notifications
You must be signed in to change notification settings - Fork 24
Skip CP change emails for users who have withdrawn all forecasts #3976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip CP change emails for users who have withdrawn all forecasts #3976
Conversation
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>
dd1dd83 to
108e616
Compare
|
From the logs of the integration tests:
I don't think that's me... |
| Forecast.objects.filter( | ||
| question_id__in=question_ids, | ||
| ) | ||
| .filter(Q(end_time__isnull=True) | Q(end_time__gt=timezone.now())) | ||
| .values_list("author_id", flat=True) | ||
| .distinct() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude Reuse Forecast.objects.active() of ForecastQuerySet
Thank you. This was an old issue with integration tests on PRs from forks (GitHub <> secrets <> forks) that I’ve just fixed — #3983. Could you please pull the latest changes? |
|
ah, sorry, I didn't have time to get to it until today thanks for merging it! |
Summary
Changes
get_users_with_active_forecasts_for_questions()that returns user IDs with at least one active forecast (whereend_timeis NULL or in the future)notify_post_cp_change()to skip users without active forecastsTest plan
get_users_with_active_forecasts_for_questions()🤖 Generated with Claude Code