Skip to content

Commit f321e1e

Browse files
committed
Move the version v prefix from db to_json to import_json command
1 parent 30c2eab commit f321e1e

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

cohorts/cli.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@ def import_json_command():
4242
count = 0
4343
for hardware, variants in fw_config["hardware"].items():
4444
for kind, entry in variants.items():
45-
version = entry["version"]
45+
raw_version = entry["version"]
46+
version = f"v{raw_version}"
4647
sha256 = entry["sha-256"]
47-
url = f"{config['FIRMWARE_ROOT']}/{hardware}/Pebble-{version}-{hardware}.pbz"
48-
timestamp = timestamps_map[version]
49-
notes = notes_map.get(version)
48+
url = f"{config['FIRMWARE_ROOT']}/{hardware}/Pebble-{raw_version}-{hardware}.pbz"
49+
timestamp = timestamps_map[raw_version]
50+
notes = notes_map.get(raw_version)
5051
_upsert_firmware(hardware, kind, version, url, sha256, timestamp, notes)
5152
count += 1
5253
db.session.commit()

cohorts/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ def to_json(self):
2020
return {
2121
"url": self.url,
2222
"sha-256": self.sha256,
23-
"friendlyVersion": f"v{self.version}",
23+
"friendlyVersion": self.version,
2424
"timestamp": self.timestamp,
25-
"notes": self.notes if self.notes else f"v{self.version}",
25+
"notes": self.notes if self.notes else self.version,
2626
}
2727

2828

0 commit comments

Comments
 (0)