Skip to content
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

Fix error in BlossomUser.date_last_active calculation #464

Open
TimJentzsch opened this issue Feb 6, 2023 · 0 comments
Open

Fix error in BlossomUser.date_last_active calculation #464

TimJentzsch opened this issue Feb 6, 2023 · 0 comments
Labels
API Suggestion which would change the user-facing API Bug Something isn't working Slack An issue related to Slack (e.g. a Slack command)

Comments

@TimJentzsch
Copy link
Contributor

recently_claimed = (
Submission.objects.filter(claimed_by=self).order_by("-claim_time").first()
)
recent_claim_time = recently_claimed.claim_time if recently_claimed else None
recently_completed = (
Submission.objects.filter(completed_by=self)
.order_by("-complete_time")
.first()
)
recent_complete_time = (
recently_completed.complete_time if recently_completed else None
)

When there are null entries for complete_time or claim_time, these actually appear first with the -complete_time and -claim_time orderings.

So we need to explicitly filter out null entries, e.g. by using complete_time__isnull=False.

@TimJentzsch TimJentzsch added Bug Something isn't working API Suggestion which would change the user-facing API Slack An issue related to Slack (e.g. a Slack command) labels Feb 6, 2023
@TimJentzsch TimJentzsch self-assigned this Feb 6, 2023
@TimJentzsch TimJentzsch removed their assignment Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Suggestion which would change the user-facing API Bug Something isn't working Slack An issue related to Slack (e.g. a Slack command)
Projects
None yet
Development

No branches or pull requests

1 participant