Skip to content

Commit 75d6e0d

Browse files
committed
Try to ensure that homepage and changelog are str or None
1 parent ebe905a commit 75d6e0d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

_validate/createJson.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,15 @@ def _createDataclassMatchingJsonSchema(
108108
raise KeyError(f"Manifest missing required key '{key}'.")
109109
# Add optional fields
110110
homepage = manifest.get("url") # type: ignore[reportUnknownMemberType]
111+
if homepage == "None":
112+
# The config default is None
113+
# which is parsed by configobj as a string not a NoneType
114+
homepage = None
111115
changelog = manifest.get("changelog") # type: ignore[reportUnknownMemberType]
116+
if changelog == "None":
117+
# The config default is None
118+
# which is parsed by configobj as a string not a NoneType
119+
changelog = None
112120
translations: list[dict[str, str]] = []
113121
for langCode, translatedManifest in getAddonManifestLocalizations(manifest):
114122
try:
@@ -147,8 +155,8 @@ def _createDataclassMatchingJsonSchema(
147155
publisher=publisher,
148156
sourceURL=sourceUrl,
149157
license=licenseName,
150-
homepage=homepage, # type: ignore[reportUnknownMemberType]
151-
changelog=changelog, # type: ignore[reportUnknownMemberType]
158+
homepage=homepage,
159+
changelog=changelog,
152160
licenseURL=licenseUrl,
153161
submissionTime=getCurrentTime(),
154162
translations=translations,

0 commit comments

Comments
 (0)