jdholtz / auto-southwest-check-in

A Python script that automatically checks in to your Southwest flight 24 hours beforehand.
GNU General Public License v3.0
440 stars 85 forks source link

Lap Child's boarding position displaying as NoneNone #204

Closed PeterCarnesciali-minted closed 8 months ago

PeterCarnesciali-minted commented 8 months ago

Version

Auto-Southwest Check-In v7.1

Browser Version

chrome 120

Description

When a reservation has a lap child, they don't get their own boarding position, but the bot is saying they were given NoneNone

To Reproduce

Make reservation with Lap child check in with the bot

Output says

Firstname Lastname got A53!
Lapfirstname Laplastname got NoneNone!

Expected Behavior

The lap child doesn't need to be mentioned, I think. Or mentioned different.

Relevant logs and program output

No response

Additional context

No response

jdholtz commented 8 months ago

Thanks for reporting this. This won’t be possible for me to reproduce (I don't have a reservation with a lap child). Therefore, can you put print(boarding_pass) on line 87 of lib/notification_handler.py? Then rerun the script and paste the output here (cleaning it to ensure no personal information is leaked). That way I can fix this issue without needing a reservation with a lap child.

PeterCarnesciali-minted commented 8 months ago
{
    "messages": None,
    "contactInformationMessage": {
        "key": "VERIFY_CONTACT_METHOD",
        "header": None,
        "body": "Please verify that your day of travel contact method is correct so we can keep you updated on changes or cancellations.",
        "icon": "NONE",
        "textColor": "DEFAULT",
        "linkText": "Edit contact method",
    },
    "title": {
        "key": "CHECKIN__YOURE_CHECKEDIN",
        "body": "You're checked in!",
        "icon": "SUCCESS",
        "textColor": "NORMAL",
    },
    "flights": [
        {
            "boundIndex": 0,
            "segmentType": "DEPARTING",
            "departureTime": "redacted",
            "gate": "redacted",
            "passengers": [
                {
                    "name": "Firstname Lastname",
                    "hasPrecheck": True,
                    "boardingGroup": "A",
                    "boardingPosition": "38",
                    "mobileBoardingPassEligible": True,
                    "mobileBoardingPassIneligibilityErrorCode": "",
                    "greyBoxMessage": None,
                    "specialAssistanceMessage": None,
                    "travelerSegmentIdentifier": "redacted",
                    "travelerID": "redacted",
                    "passengerLabelText": "PASSENGER",
                    "hasInfant": True,
                    "infantTravelerID": "redacted",
                    "checkedIn": True,
                    "confirmationNumber": "redacted",
                    "isInfant": False,
                    "_links": {
                        "viewPassengerBoardingPass": {
                            "href": "/v1/mobile-air-operations/page/check-in/retrieve-boarding-pass/redacted",
                            "method": "POST",
                            "body": {
                                "firstName": "Firstname",
                                "lastName": "Lastname",
                                "passengerSearchToken": "redacted",
                                "travelerID": ["redacted"],
                            },
                            "labelText": "Boarding pass",
                        },
                        "healthDocument": None,
                    },
                },
                {
                    "name": "Lapfirstname Laplastname",
                    "hasPrecheck": True,
                    "boardingGroup": None,
                    "boardingPosition": None,
                    "mobileBoardingPassEligible": False,
                    "mobileBoardingPassIneligibilityErrorCode": "",
                    "greyBoxMessage": {
                        "key": "GREY_BOX_UNAVAILABLE_INFANT_ON_LAP_DOMESTIC",
                        "header": "Passengers with Lap Children will need to print documents at the airport to board.",
                        "body": "Visit the kiosk to get Lap Child boarding documents with other boarding passes.",
                    },
                    "specialAssistanceMessage": None,
                    "travelerSegmentIdentifier": "redacted",
                    "travelerID": "redacted",
                    "passengerLabelText": "PASSENGER (LAP CHILD)",
                    "hasInfant": False,
                    "passengerIcon": "lap-child",
                    "checkedIn": True,
                    "confirmationNumber": "redacted",
                    "isInfant": True,
                    "_links": {
                        "viewPassengerBoardingPass": None,
                        "healthDocument": None,
                    },
                },
            ],
            "originAirportCode": "redacted",
            "destinationAirportCode": "redacted",
            "flightNumber": "redacted",
            "hasWifi": True,
            "travelTime": "redacted",
            "isOvernight": False,
        }
    ],
    "footerWithLinks": '<a href="https://www.southwest.com/html/customer-service/airport-experience/mobile-boarding-pass.html" target="_blank">Mobile boarding pass FAQ</a>. Do you have a <a href="https://www.tsa.gov/real-id" target="_blank">REAL ID</a>? Beginning May 7, 2025, you will need a state-issued REAL ID compliant license or identification card, or another acceptable form of ID (such as a passport), to fly within the United States. <a href="https://www.tsa.gov/real-id" target="_blank">Learn More</a>',
    "delim": "|",
    "_analytics": {"checkin.odout": "redacted"},
    "_links": {
        "checkInSessionToken": "redacted",
        "viewAllBoardingPasses": {
            "href": "/v1/mobile-air-operations/page/check-in/retrieve-boarding-pass/redacted",
            "method": "POST",
            "body": {
                "firstName": "Lapfirstname",
                "lastName": "Laplastname",
                "passengerSearchToken": "redacted",
                "travelerID": ["redacted"],
            },
            "labelText": "View all boarding passes",
            "nonSequentialPositionsMessage": None,
        },
        "contactInformation": {
            "href": "/v1/mobile-air-booking/page/view-reservation/contact-info/redacted",
            "method": "GET",
            "query": {
                "passenger-search-token": "redacted"
            },
        },
        "viewUpgradedBoarding": {
            "href": "/v1/mobile-air-operations/page/upgraded-boarding/redacted",
            "method": "POST",
            "body": {
                "passengerSearchToken": "redacted"
            },
            "labelText": "Upgrade boarding position to A1-A15",
        },
        "viewModifyCheckedBags": {
            "url": "https://mobile.southwest.com/air/baggage/select?clk=CHKIN_CHECKBAGS",
            "labelText": "Check standard bags now",
            "href": "doNotUse",
            "query": {
                "first_name": "Firstname",
                "last_name": "Lastname",
                "record_locator": "redacted",
            },
        },
    },
    "mktg_data": {
        "appContext": "Upgraded-Boarding",
        "delimitedAppContexts": "Upgraded-Boarding",
        "upgradeboarding_available": "1",
        "at_boarding_position": "A38",
        "at_upgradeboard_eligible": "1",
        "at_business_select_upgrade_eligible": "0",
        "air_bound1_origin": "redacted",
        "air_bound1_destination": "redacted",
        "air_bound2_origin": "none",
        "air_bound2_destination": "none",
    },
}
jdholtz commented 8 months ago

Thank you for that information. I’ll probably just check to make sure a boarding group exists for a passenger before printing their name (it will cover more cases than just checking if it is a lap child—although I’m not sure what those other cases are).

Do you prefer to not have the lap child shown at all or do you want the script to display it in some other way (and what would that look like)?

PeterCarnesciali-minted commented 8 months ago

I would probably exclude it from the log if there's not a boarding position. I don't think there's a reason to show the lap child at all.

PeterCarnesciali-minted commented 8 months ago

I'm happy to PR that if you'd like.

jdholtz commented 8 months ago

I'm happy to PR that if you'd like.

Yeah, that'd be great. It would also be great if you could either add a test for it or modify an existing one to ensure this issue will be caught in the future.