Skip to content

Commit 94f0e8a

Browse files
committed
Include pending acceptance when listing all speakers for an event
This seems better in line with our principle of always showing the WiP state.
1 parent 896d9bb commit 94f0e8a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/samaware/queries.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from itertools import chain
22

3+
from django.db.models import Q
34
from django.utils import timezone
45
from django_scopes import scopes_disabled
56
from pretalx.person.models import SpeakerProfile
@@ -13,7 +14,9 @@ def get_all_speakers(event):
1314
released schedule, whereas this considers the current submission states.
1415
"""
1516

16-
accepted_submissions = event.submissions.filter(state__in=SubmissionStates.accepted_states)
17+
accepted_submissions = event.submissions.filter(
18+
Q(state__in=SubmissionStates.accepted_states) | Q(pending_state__in=SubmissionStates.accepted_states)
19+
)
1720
profiles = SpeakerProfile.objects.filter(user__submissions__in=accepted_submissions)
1821

1922
return profiles.distinct()

tests/test_queries.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ def test_all_speakers(self):
2323
self.assertIn('Richard Khan', speaker_names)
2424
self.assertNotIn('Donna Bailey', speaker_names)
2525

26+
with scope(event=self.event):
27+
submission = Submission.objects.get(state=SubmissionStates.REJECTED)
28+
submission.pending_state = SubmissionStates.ACCEPTED
29+
submission.save()
30+
31+
speakers = queries.get_all_speakers(self.event)
32+
33+
self.assertEqual(len(speakers), 6)
34+
2635
def test_arrived_speakers(self):
2736
with scope(event=self.event):
2837
tammy = SpeakerProfile.objects.get(id=2)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy