civics-cdf-validator 1.64.dev2__tar.gz → 1.64.dev4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {civics_cdf_validator-1.64.dev2/civics_cdf_validator.egg-info → civics_cdf_validator-1.64.dev4}/PKG-INFO +1 -1
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4/civics_cdf_validator.egg-info}/PKG-INFO +1 -1
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/rules.py +16 -49
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/version.py +1 -1
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/CONTRIBUTING.md +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/LICENSE-2.0.txt +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/MANIFEST.in +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/README.md +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/__init__.py +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/base.py +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/civics_cdf_validator.egg-info/SOURCES.txt +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/civics_cdf_validator.egg-info/dependency_links.txt +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/civics_cdf_validator.egg-info/entry_points.txt +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/civics_cdf_validator.egg-info/requires.txt +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/civics_cdf_validator.egg-info/top_level.txt +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/gpunit_rules.py +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/loggers.py +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/office_utils.py +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/setup.cfg +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/setup.py +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/stats.py +0 -0
- {civics_cdf_validator-1.64.dev2 → civics_cdf_validator-1.64.dev4}/validator.py +0 -0
|
@@ -2191,57 +2191,24 @@ class VoteCountValidSeatsDeltaTypes(base.BaseRule):
|
|
|
2191
2191
|
"""Ensure VoteCount seats delta types are valid."""
|
|
2192
2192
|
|
|
2193
2193
|
def elements(self):
|
|
2194
|
-
return ["
|
|
2194
|
+
return ["BallotSelection"] + list(
|
|
2195
|
+
self.get_element_names_for_type("SpecialBallotSelection")
|
|
2196
|
+
)
|
|
2195
2197
|
|
|
2196
2198
|
def check(self, element):
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
msg = (
|
|
2211
|
-
"The VoteCount types seats-delta and seats-delta-mandate should"
|
|
2212
|
-
" not coexist within the same BallotSelection (objectId={})."
|
|
2213
|
-
" They represent the same data, and seats-delta is scheduled"
|
|
2214
|
-
" for deprecation."
|
|
2215
|
-
).format(ballot_selection_obj_id)
|
|
2216
|
-
raise loggers.ElectionWarning.from_message(msg, [element])
|
|
2217
|
-
if (
|
|
2218
|
-
"seats-delta-institutional" in ballot_selection_vote_types
|
|
2219
|
-
and "seats-delta-mandate" not in ballot_selection_vote_types
|
|
2220
|
-
):
|
|
2221
|
-
msg = (
|
|
2222
|
-
"Missing required field VoteCount type seats-delta-mandate must"
|
|
2223
|
-
" be included whenever VoteCount type seats-delta-institutional"
|
|
2224
|
-
" is present. (BallotSelection objectId={})"
|
|
2225
|
-
).format(ballot_selection_obj_id)
|
|
2226
|
-
raise loggers.ElectionError.from_message(msg, [element])
|
|
2227
|
-
if "seats-delta" in ballot_selection_vote_types:
|
|
2228
|
-
current_date = datetime.datetime.now()
|
|
2229
|
-
deletion_date = datetime.datetime(2026, 7, 1)
|
|
2230
|
-
# If current date is before July 1st, 2026
|
|
2231
|
-
if current_date < deletion_date:
|
|
2232
|
-
msg = (
|
|
2233
|
-
"VoteCount type seats-delta is deprecated and will be removed"
|
|
2234
|
-
" on July 1, 2026. Please update your implementation to use"
|
|
2235
|
-
" seats-delta-mandate. (BallotSelection objectId={})"
|
|
2236
|
-
).format(ballot_selection_obj_id)
|
|
2237
|
-
raise loggers.ElectionWarning.from_message(msg, [element])
|
|
2238
|
-
else:
|
|
2239
|
-
msg = (
|
|
2240
|
-
"VoteCount type seats-delta is deprecated and was removed on"
|
|
2241
|
-
" July 1, 2026. Please update your implementation to use"
|
|
2242
|
-
" seats-delta-mandate. (BallotSelection objectId={})"
|
|
2243
|
-
).format(ballot_selection_obj_id)
|
|
2244
|
-
raise loggers.ElectionError.from_message(msg, [element])
|
|
2199
|
+
vote_count_types = set()
|
|
2200
|
+
vote_counts_collection = element.find("VoteCountsCollection")
|
|
2201
|
+
if vote_counts_collection is None:
|
|
2202
|
+
return
|
|
2203
|
+
for vote_counts in vote_counts_collection.findall("VoteCounts"):
|
|
2204
|
+
vote_count_types.add(_get_type_or_other_type(vote_counts))
|
|
2205
|
+
if "seats-delta" in vote_count_types:
|
|
2206
|
+
raise loggers.ElectionError.from_message(
|
|
2207
|
+
"Legacy VoteCounts type seats-delta is no longer supported as of"
|
|
2208
|
+
" July 1, 2026. Please update your implementation to use"
|
|
2209
|
+
" seats-delta-mandate and/or seats-delta-institutional.",
|
|
2210
|
+
[element],
|
|
2211
|
+
)
|
|
2245
2212
|
|
|
2246
2213
|
|
|
2247
2214
|
class URIValidator(base.BaseRule):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|