Skip to content

Commit

Permalink
feat (#1730): Allows scheduling of pending accepted/pending confirmed…
Browse files Browse the repository at this point in the history
… talks
  • Loading branch information
margau committed Apr 5, 2024
1 parent dd9f391 commit 324f6dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/pretalx/orga/views/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ def do(self, force=False, pending=False):
if pending:
self.object.pending_state = self._target
self.object.save()
if self.object.pending_state in [
SubmissionStates.ACCEPTED,
SubmissionStates.CONFIRMED,
]:
# allow configureability of pending accepted/confirmed talks
self.object.update_talk_slots()
else:
method = getattr(self.object, SubmissionStates.method_names[self._target])
method(person=self.request.user, force=force, orga=True)
Expand Down
5 changes: 4 additions & 1 deletion src/pretalx/submission/models/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,10 @@ def update_talk_slots(self):
"""
from pretalx.schedule.models import TalkSlot

if self.state not in [SubmissionStates.ACCEPTED, SubmissionStates.CONFIRMED]:
# scheduling is only allowed (and therefore slots needed) for accepted and confirmed talks, or those pending counterparts
scheduling_allowed = self.state in [SubmissionStates.ACCEPTED, SubmissionStates.CONFIRMED] or self.pending_state in [SubmissionStates.ACCEPTED, SubmissionStates.CONFIRMED]

if not scheduling_allowed:
TalkSlot.objects.filter(
submission=self, schedule=self.event.wip_schedule
).delete()
Expand Down

0 comments on commit 324f6dc

Please sign in to comment.