~martijnbraam/shipments

9feaaf2f99daf3228d6c85525bd6fcc66ce582b7 — Ferenc Géczi 2 years ago 6c173c3
carrier: dhl: Make absolutely sure that an API key is in the extra
1 files changed, 3 insertions(+), 0 deletions(-)

M shipments/carrier.py
M shipments/carrier.py => shipments/carrier.py +3 -0
@@ 394,6 394,9 @@ class DHL(Carrier):
        ]

    def get_info(self, code, extra):
        if not 'apikey' in extra:
            raise ValueError("Missing 'apikey' in extra data")

        url = 'https://api-eu.dhl.com/track/shipments'
        headers = {
            'Accept': 'application/json',