Update shipment with carrier for a given tracking number
- Added a check to print a message if the shipment does not exist and the update flag is set - Added an error message for cases where a shipment cannot be created because it does not exist
This commit is contained in:
parent
dafce82106
commit
e9c7ed12d3
2 changed files with 6 additions and 1 deletions
|
@ -140,6 +140,11 @@ def main():
|
|||
print(
|
||||
f"Updated shipment for {args.tracking_number} with carrier {args.carrier}"
|
||||
)
|
||||
|
||||
if shipment is None and args.update:
|
||||
print(f"Shipment {args.tracking_number} does not exist. Remove -u to create.")
|
||||
exit(1)
|
||||
|
||||
else:
|
||||
tracker.db.create_shipment(
|
||||
args.tracking_number, args.carrier, args.description
|
||||
|
|
|
@ -12,4 +12,4 @@ secret = api_secret
|
|||
[DHL]
|
||||
key = api_key
|
||||
secret = api_secret
|
||||
ratelimited = 1
|
||||
ratelimited = 1
|
||||
|
|
Loading…
Reference in a new issue