Skip to content

Commit

Permalink
Send only new open ended permit orders to Talpa
Browse files Browse the repository at this point in the history
Include periodUnit and periodFrequency only
for new open ended permits.
  • Loading branch information
mhieta committed Nov 22, 2023
1 parent 8ec09ce commit 7111f14
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions parking_permits/talpa/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.utils.translation import gettext_lazy as _

from parking_permits.exceptions import OrderCreationFailed, SetTalpaFlowStepsError
from parking_permits.models.order import OrderPaymentType
from parking_permits.models.order import OrderPaymentType, OrderType
from parking_permits.utils import (
DefaultOrderedDict,
date_time_to_helsinki,
Expand Down Expand Up @@ -55,7 +55,8 @@ def _create_item_data(cls, order, order_item):
},
],
}
if order_item.permit.is_open_ended:
# Include periodUnit and periodFrequency only for new open ended permits.
if order_item.permit.is_open_ended and order.type == OrderType.CREATED:
item.update(
{
"periodUnit": TALPA_SUBSCRIPTION_PERIOD_UNIT,
Expand Down

0 comments on commit 7111f14

Please sign in to comment.