Gate db.add() around --dry-run to ensure other logic exercised

This commit is contained in:
XANTRONIX 2025-03-02 20:56:24 -05:00
parent f902201702
commit bfc3d87d73

View file

@ -33,14 +33,14 @@ for path in getattr(args, 'raob-sounding-file'):
if station is not None: if station is not None:
sounding.station = station.code sounding.station = station.code
if args.dry_run: if not args.dry_run:
continue db.add(sounding)
db.add(sounding)
for sample in sounding.samples: for sample in sounding.samples:
sample.sounding_id = sounding.id sample.sounding_id = sounding.id
db.add(sample)
if not args.dry_run:
db.add(sample)
if not args.dry_run: if not args.dry_run:
db.commit() db.commit()