Skip to content

Commit

Permalink
Flag proposals outside their allowed times
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonty committed May 20, 2024
1 parent 3731fb2 commit 3f3ecae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/cfp_review/sense_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ def _check_timing(t, note, reason_key):
if t.hour >= 2 and t.hour < 9:
reasons[f'{reason_key}_quiet'] = f'{note} is scheduled between 2am and 9am ({t.strftime(human_format)})'

permitted_time = False
for n, period in enumerate(proposal.get_allowed_time_periods()):
if t >= period.start and t <= period.end:
permitted_time = True

if not permitted_time:
reasons[f'{reason_key}_outside_allowed_times'] = f'{note} is outside allowed proposal time periods'

_check_timing(proposal.potential_time, 'Proposed start', 'proposed_start')
_check_timing(proposal.scheduled_time, 'Scheduled start', 'scheduled_start')
_check_timing(proposal.potential_end_date, 'Proposed end', 'proposed_end')
Expand All @@ -92,6 +100,7 @@ def sense_check():
accepted_proposals = (
Proposal.query_accepted(include_user_scheduled=False)
.filter(Proposal.type.in_(["talk", "workshop", "youthworkshop", "performance"]))
.order_by(Proposal.type)
.all()
)

Expand Down

0 comments on commit 3f3ecae

Please sign in to comment.