Last active
January 13, 2021 13:36
-
-
Save a-rmz/3919d9aacd0c1c9840f8a39fd3e2f07e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from payments.enums import OrderStatus | |
from payments.models import Order | |
from resources.enums import BerthMooringType | |
orders = Order.objects.filter( | |
status=OrderStatus.ERROR, | |
comment__contains="Asiakkaan sähköpostiosoite puuttuu" | |
) | |
for order in orders: | |
if order.lease.berth.berth_type.mooring_type not in (BerthMooringType.DINGHY_PLACE, BerthMooringType.TRAWLER_PLACE): | |
order.lease.delete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment