Allow a season method with sources, where the pages differ
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cb6cdadd41
commit
667b2ea00f
4 files changed
+27
-6
No files matched your search
+9
-5
@@ -41,14 +41,18 @@ def check_season(tid, hike, errors):
|
||||
errors.append(
|
||||
f"{tid}: hike.season_basis must be one of {', '.join(BASES)}, not {basis!r}")
|
||||
|
||||
if basis == "estimate":
|
||||
if has_method:
|
||||
method = hike.get("season_method")
|
||||
if not isinstance(method, str) or not method.strip():
|
||||
errors.append(f"{tid}: hike.season_method is required with season_basis \"estimate\"")
|
||||
if basis not in ("estimate", "sources"):
|
||||
errors.append(
|
||||
f"{tid}: hike.season_method is only given with season_basis \"estimate\" "
|
||||
"or \"sources\"")
|
||||
elif not isinstance(method, str) or not method.strip():
|
||||
errors.append(f"{tid}: hike.season_method must not be empty")
|
||||
elif len(method) >= 400:
|
||||
errors.append(f"{tid}: hike.season_method must be under 400 characters")
|
||||
elif has_method:
|
||||
errors.append(f"{tid}: hike.season_method is only given with season_basis \"estimate\"")
|
||||
elif basis == "estimate":
|
||||
errors.append(f"{tid}: hike.season_method is required with season_basis \"estimate\"")
|
||||
|
||||
naming_season = _naming(sources, "season")
|
||||
if basis in ("primary", "source"):
|
||||
|
||||
Reference in new issue
Block a user