civics-cdf-validator 1.66.dev13__tar.gz → 1.66.dev14__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.66.dev13/civics_cdf_validator.egg-info → civics_cdf_validator-1.66.dev14}/PKG-INFO +1 -1
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14/civics_cdf_validator.egg-info}/PKG-INFO +1 -1
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/rules.py +19 -3
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/version.py +1 -1
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/CONTRIBUTING.md +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/LICENSE-2.0.txt +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/MANIFEST.in +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/README.md +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/__init__.py +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/base.py +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/civics_cdf_validator.egg-info/SOURCES.txt +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/civics_cdf_validator.egg-info/dependency_links.txt +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/civics_cdf_validator.egg-info/entry_points.txt +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/civics_cdf_validator.egg-info/requires.txt +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/civics_cdf_validator.egg-info/top_level.txt +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/gpunit_rules.py +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/loggers.py +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/office_utils.py +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/setup.cfg +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/setup.py +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/stats.py +0 -0
- {civics_cdf_validator-1.66.dev13 → civics_cdf_validator-1.66.dev14}/validator.py +0 -0
|
@@ -945,9 +945,10 @@ class CandidatesReferencedInRelatedContests(base.BaseRule):
|
|
|
945
945
|
"""Candidate should not be referred to by multiple unrelated contests.
|
|
946
946
|
|
|
947
947
|
A Candidate object should only be referenced from one contest, unless the
|
|
948
|
-
contests are related (connected by ComposingContestIds
|
|
949
|
-
running in multiple unrelated Contests,
|
|
950
|
-
several times over, but a Candida(te|cy)
|
|
948
|
+
contests are related (connected by ComposingContestIds or
|
|
949
|
+
SubsequentContestId). If a Person is running in multiple unrelated Contests,
|
|
950
|
+
then that Person is a Candidate several times over, but a Candida(te|cy)
|
|
951
|
+
can't span unrelated contests.
|
|
951
952
|
"""
|
|
952
953
|
|
|
953
954
|
def __init__(self, election_tree, schema_tree, **kwargs):
|
|
@@ -1005,6 +1006,21 @@ class CandidatesReferencedInRelatedContests(base.BaseRule):
|
|
|
1005
1006
|
self.contest_graph.add_node(contest.get("objectId"))
|
|
1006
1007
|
|
|
1007
1008
|
for contest in contests:
|
|
1009
|
+
subsequent_contest = contest.find("SubsequentContestId")
|
|
1010
|
+
if element_has_text(subsequent_contest):
|
|
1011
|
+
subsequent_contest_id = subsequent_contest.text
|
|
1012
|
+
# subsequent contest id is not valid if it isn't in the graph
|
|
1013
|
+
if not self.contest_graph.has_node(subsequent_contest_id):
|
|
1014
|
+
raise loggers.ElectionError.from_message(
|
|
1015
|
+
(
|
|
1016
|
+
"Contest {} contains a subsequent Contest Id ({}) that does "
|
|
1017
|
+
"not exist."
|
|
1018
|
+
).format(contest.get("objectId"), subsequent_contest_id),
|
|
1019
|
+
[subsequent_contest],
|
|
1020
|
+
)
|
|
1021
|
+
self.contest_graph.add_edge(
|
|
1022
|
+
contest.get("objectId"), subsequent_contest_id
|
|
1023
|
+
)
|
|
1008
1024
|
# Add the composing contest if it exists
|
|
1009
1025
|
composing_contests = contest.find("ComposingContestIds")
|
|
1010
1026
|
if element_has_text(composing_contests):
|
|
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
|