Add DRAFT state in conditional check (#1422)

Add DRAFT state in conditional check
This commit is contained in:
B.Fatih KOZ 2022-02-28 17:52:57 +03:00 committed by GitHub
parent 9d368e8efa
commit 7a40a9d128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -485,8 +485,8 @@ class PirepService extends Service
$default_state = $pirep->state;
}
// If pirep is still at PENDING state decide the default behavior by looking at rank settings
if ($pirep->state === PirepState::PENDING) {
// If pirep is still at PENDING or DRAFT state decide the default behavior by looking at rank settings
if ($pirep->state === PirepState::PENDING || $pirep->state === PirepState::DRAFT) {
if ($pirep->source === PirepSource::ACARS && $pirep->user->rank->auto_approve_acars) {
$default_state = PirepState::ACCEPTED;
} elseif ($pirep->source === PirepSource::MANUAL && $pirep->user->rank->auto_approve_manual) {