Check-in: New error reason for unapproved orders (#3741)

* Check-in: New error reason for unapproved orders

* Fix documentation verbiage
This commit is contained in:
Raphael Michel
2023-11-28 12:50:29 +01:00
committed by GitHub
parent 1593eacb6b
commit 965fcec9df
11 changed files with 46 additions and 37 deletions

View File

@@ -874,6 +874,15 @@ def perform_checkin(op: OrderPosition, clist: CheckinList, given_answers: dict,
'blocked'
)
if op.order.status == Order.STATUS_PENDING and op.order.require_approval:
if force:
force_used = True
else:
raise CheckInError(
_('This order is not yet approved.'),
'unapproved',
)
if type != Checkin.TYPE_EXIT and op.valid_from and op.valid_from > dt:
if force:
force_used = True
@@ -941,14 +950,6 @@ def perform_checkin(op: OrderPosition, clist: CheckinList, given_answers: dict,
'product'
)
if op.order.status != Order.STATUS_PAID and op.order.require_approval:
if force:
force_used = True
else:
raise CheckInError(
_('This order is not yet approved.'),
'unpaid'
)
elif op.order.status != Order.STATUS_PAID and not op.order.valid_if_pending and not (
ignore_unpaid and clist.include_pending and op.order.status == Order.STATUS_PENDING
):