Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Fix error in BlossomUser.date_last_active calculation #464

@TimJentzsch

Description

@TimJentzsch

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    APISuggestion which would change the user-facing APIBugSomething isn't workingSlackAn issue related to Slack (e.g. a Slack command)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions