Skip to content

Commit 28afd65

Browse files
authored
Exclude spam and deleted Registration from queryset (#11572)
1 parent c4b83ec commit 28afd65

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

api/providers/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
WhitelistedSHAREPreprintProvider,
7979
)
8080
from osf.models.action import RegistrationAction, CollectionSubmissionAction
81+
from osf.models.spam import SpamStatus
8182
from osf.registrations.utils import (
8283
BulkRegistrationUpload,
8384
InvalidHeadersError,
@@ -778,6 +779,9 @@ def get_default_queryset(self):
778779

779780
return Registration.objects.filter(
780781
provider=provider,
782+
deleted__isnull=True,
783+
).exclude(
784+
spam_status__in=[SpamStatus.FLAGGED, SpamStatus.SPAM],
781785
).annotate(
782786
revision_state=registration_annotations.REVISION_STATE,
783787
**resource_annotations.make_open_practice_badge_annotations(),

0 commit comments

Comments
 (0)