File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -314,13 +314,17 @@ BEGIN
314314 END IF;
315315
316316 scheduled_at := COALESCE(NEW .scheduled_at );
317-
317+
318318 -- We need to correctly handle the cancels_at field, since matches open 15 minutes before the scheduled time.
319319 -- Therefore, cancels_at should be set relative to the scheduled time, not the current time.
320- IF (scheduled_at IS NOT NULL AND scheduled_at < NOW()) THEN
320+ IF (scheduled_at IS NOT NULL AND scheduled_at < NOW() AND NEW . status = ' Scheduled ' ) THEN
321321 NEW .scheduled_at = NOW();
322322 END IF;
323323
324+ IF NEW .status != ' Scheduled' THEN
325+ NEW .scheduled_at = null ;
326+ END IF;
327+
324328 IF (NEW .status = ' WaitingForCheckIn' AND OLD .status != ' WaitingForCheckIn' ) THEN
325329 IF _auto_cancellation THEN
326330 NEW .cancels_at = COALESCE(scheduled_at, NOW()) + (_auto_cancel_duration)::interval;
You can’t perform that action at this time.
0 commit comments