diff --git a/orm/entities/Area/Electorate/AdministrativeDistrict.py b/orm/entities/Area/Electorate/AdministrativeDistrict.py index 550986ad..f2a38f4e 100644 --- a/orm/entities/Area/Electorate/AdministrativeDistrict.py +++ b/orm/entities/Area/Electorate/AdministrativeDistrict.py @@ -1,9 +1,6 @@ -from app import db from orm.entities.Area import Electorate -from orm.entities.Area.Electorate import Province -from orm.enums import ElectorateTypeEnum, AreaTypeEnum -from exception import NotFoundException -from sqlalchemy.orm import relationship, synonym +from orm.enums import AreaTypeEnum +from sqlalchemy.orm import synonym from sqlalchemy.ext.associationproxy import association_proxy diff --git a/orm/entities/Area/Electorate/ElectoralDistrict.py b/orm/entities/Area/Electorate/ElectoralDistrict.py index 0a2fa853..96fdd52c 100644 --- a/orm/entities/Area/Electorate/ElectoralDistrict.py +++ b/orm/entities/Area/Electorate/ElectoralDistrict.py @@ -1,10 +1,6 @@ -from app import db from orm.entities.Area import Electorate -from orm.entities.Area.Electorate import Country -from orm.enums import ElectorateTypeEnum, AreaTypeEnum -from exception import NotFoundException +from orm.enums import AreaTypeEnum from sqlalchemy.orm import synonym -from sqlalchemy.ext.associationproxy import association_proxy class ElectoralDistrictModel(Electorate.Model): diff --git a/orm/entities/Area/Electorate/PollingDistrict.py b/orm/entities/Area/Electorate/PollingDistrict.py index b680093a..b867a1da 100644 --- a/orm/entities/Area/Electorate/PollingDistrict.py +++ b/orm/entities/Area/Electorate/PollingDistrict.py @@ -1,8 +1,5 @@ -from app import db from orm.entities.Area import Electorate -from orm.entities.Area.Electorate import PollingDivision from orm.enums import AreaTypeEnum -from exception import NotFoundException from sqlalchemy.orm import synonym from sqlalchemy.ext.associationproxy import association_proxy diff --git a/orm/entities/Area/Electorate/PollingDivision.py b/orm/entities/Area/Electorate/PollingDivision.py index e476cdb7..3f08278d 100644 --- a/orm/entities/Area/Electorate/PollingDivision.py +++ b/orm/entities/Area/Electorate/PollingDivision.py @@ -1,9 +1,6 @@ -from app import db from orm.entities import Electorate -from orm.entities.Area.Electorate import ElectoralDistrict -from orm.enums import ElectorateTypeEnum, AreaTypeEnum -from exception import NotFoundException -from sqlalchemy.orm import relationship, synonym +from orm.enums import AreaTypeEnum +from sqlalchemy.orm import synonym from sqlalchemy.ext.associationproxy import association_proxy diff --git a/orm/entities/Area/Electorate/Province.py b/orm/entities/Area/Electorate/Province.py index 3080c77a..78699d08 100644 --- a/orm/entities/Area/Electorate/Province.py +++ b/orm/entities/Area/Electorate/Province.py @@ -1,14 +1,9 @@ -from app import db from orm.entities import Electorate -from orm.entities.Area.Electorate import Country -from orm.enums import ElectorateTypeEnum, AreaTypeEnum -from exception import NotFoundException -from sqlalchemy.orm import relationship, synonym +from orm.enums import AreaTypeEnum +from sqlalchemy.orm import synonym class ProvinceModel(Electorate.Model): - # parentElectorateId = db.Column(db.Integer, db.ForeignKey("electorateId"), nullable=True) - country = synonym("parentElectorate") __mapper_args__ = { diff --git a/orm/entities/Election/election_helper.py b/orm/entities/Election/election_helper.py index 75d046b4..a49ed539 100644 --- a/orm/entities/Election/election_helper.py +++ b/orm/entities/Election/election_helper.py @@ -39,27 +39,27 @@ def get_root_token(electionId): AREA_CLAIM_PREFIX + DATA_EDITOR_ROLE: str([{ "areaId": electoral_district.areaId } for electoral_district in electoral_districts]), - AREA_CLAIM_PREFIX + POLLING_DIVISION_REPORT_VIEWER_ROLE: str([{ - "areaId": electoral_district.areaId - } for electoral_district in electoral_districts]), - AREA_CLAIM_PREFIX + POLLING_DIVISION_REPORT_VERIFIER_ROLE: str([{ - "areaId": electoral_district.areaId - } for electoral_district in electoral_districts]), - AREA_CLAIM_PREFIX + ELECTORAL_DISTRICT_REPORT_VIEWER_ROLE: str([{ - "areaId": electoral_district.areaId - } for electoral_district in electoral_districts]), - AREA_CLAIM_PREFIX + ELECTORAL_DISTRICT_REPORT_VERIFIER_ROLE: str([{ - "areaId": electoral_district.areaId - } for electoral_district in electoral_districts]), - AREA_CLAIM_PREFIX + NATIONAL_REPORT_VIEWER_ROLE: str([{ - "areaId": country.areaId - } for country in countries]), - AREA_CLAIM_PREFIX + NATIONAL_REPORT_VERIFIER_ROLE: str([{ - "areaId": country.areaId - } for country in countries]), - AREA_CLAIM_PREFIX + EC_LEADERSHIP_ROLE: str([{ - "areaId": country.areaId - } for country in countries]) + # AREA_CLAIM_PREFIX + POLLING_DIVISION_REPORT_VIEWER_ROLE: str([{ + # "areaId": electoral_district.areaId + # } for electoral_district in electoral_districts]), + # AREA_CLAIM_PREFIX + POLLING_DIVISION_REPORT_VERIFIER_ROLE: str([{ + # "areaId": electoral_district.areaId + # } for electoral_district in electoral_districts]), + # AREA_CLAIM_PREFIX + ELECTORAL_DISTRICT_REPORT_VIEWER_ROLE: str([{ + # "areaId": electoral_district.areaId + # } for electoral_district in electoral_districts]), + # AREA_CLAIM_PREFIX + ELECTORAL_DISTRICT_REPORT_VERIFIER_ROLE: str([{ + # "areaId": electoral_district.areaId + # } for electoral_district in electoral_districts]), + # AREA_CLAIM_PREFIX + NATIONAL_REPORT_VIEWER_ROLE: str([{ + # "areaId": country.areaId + # } for country in countries]), + # AREA_CLAIM_PREFIX + NATIONAL_REPORT_VERIFIER_ROLE: str([{ + # "areaId": country.areaId + # } for country in countries]), + # AREA_CLAIM_PREFIX + EC_LEADERSHIP_ROLE: str([{ + # "areaId": country.areaId + # } for country in countries]) } # Generate a token with claims for everything. diff --git a/orm/entities/TallySheetVersionRow/TallySheetVersionRow_PRE_21.py b/orm/entities/TallySheetVersionRow/TallySheetVersionRow_PRE_21.py index 156708cb..983f485a 100644 --- a/orm/entities/TallySheetVersionRow/TallySheetVersionRow_PRE_21.py +++ b/orm/entities/TallySheetVersionRow/TallySheetVersionRow_PRE_21.py @@ -2,9 +2,7 @@ from app import db -from orm.entities import Candidate -from orm.entities.Election import ElectionCandidate, InvalidVoteCategory -from exception import NotFoundException +from orm.entities.Election import InvalidVoteCategory from orm.entities.SubmissionVersion import TallySheetVersion