Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
0e89ad4
Election-Day: Improves error messages in API
treinhard Mar 13, 2026
861fee9
Merge branch 'master' into eCH-0252
treinhard Mar 16, 2026
fbe95b9
Election-Day: Adds support for eCH-0252 V2.0.0
treinhard Mar 16, 2026
a147683
Fixes typing issues.
treinhard Mar 16, 2026
a0d220d
Election-Day: Improves error message for unsupported DOI
treinhard Mar 16, 2026
c9067c0
Ignores SK (Stadtkreis) DOI in election upload.
treinhard Mar 16, 2026
c0e670c
Increases file limit to 100MB for election upload.
treinhard Mar 16, 2026
4a0a8a0
Merge branch 'master' into eCH-0252
treinhard Mar 18, 2026
fe93a08
Avoids AssertionError in election day pdf generation.
treinhard Mar 19, 2026
249358f
Merge branch 'master' into eCH-0252
treinhard Mar 19, 2026
f64bc6d
Adds some logging to ech import.
treinhard Mar 20, 2026
5cc327d
Adds test for ech majority election SG.
treinhard Mar 20, 2026
75dc61b
Gitignores Mac index files.
treinhard Mar 20, 2026
e32b1c9
Adds test for ech proportional election SG.
treinhard Mar 20, 2026
a18aa40
Removes eCH ZH tests (replaced by SG).
treinhard Mar 20, 2026
4580d6e
Adds test for ech import with multiple elections.
treinhard Mar 20, 2026
5c58a21
Election-Day: No longer delete elections on the same date.
treinhard Mar 20, 2026
0b9d4cd
Avoids IntegrityError when upload combined (info + results) eCH 0252 …
treinhard Mar 26, 2026
1e258f0
Aborts transaction upon 500 error in WAB API.
treinhard Mar 26, 2026
423d93f
Merge branch 'master' into eCH-0252
treinhard Mar 26, 2026
933720f
View/path for communal election/vote archived results
Tschuppi81 Apr 30, 2026
2734810
Add municipality name error message for invalid municipality
Tschuppi81 May 1, 2026
cf1a914
Update translations
Tschuppi81 May 1, 2026
4acf50e
Merge branch 'eCH-0252' into feature/ogc-3103-wab-communal-elections
Tschuppi81 May 4, 2026
f67b865
Add minimal dependency for pyOpenSSL due to pysaml2,
Tschuppi81 May 4, 2026
e9408a2
Enable ech xml vote upload
Tschuppi81 May 4, 2026
c7da5fc
Fix municipality filter
Tschuppi81 May 4, 2026
94d2313
Update translations
Tschuppi81 May 4, 2026
17c021f
Adds segement level for archive view (municipality title)
Tschuppi81 May 4, 2026
c822395
Builds Python from source.
treinhard May 5, 2026
a3cb9de
Revert "Builds Python from source."
treinhard May 5, 2026
5d66124
Adjust dockerfile to see the failing apt package
Tschuppi81 May 5, 2026
6864a12
Merge branch 'feature/ogc-3103-wab-communal-elections' of github.com:…
Tschuppi81 May 5, 2026
dc05658
Revert "Adjust dockerfile to see the failing apt package"
Tschuppi81 May 5, 2026
9a918c6
Add view for municipal results for date and rework archive template
Tschuppi81 May 5, 2026
8e8c6f7
Rework and cleanup
Tschuppi81 May 6, 2026
390789a
Ensure ech xml upload for elections
Tschuppi81 May 6, 2026
672d745
Link from municipal view to municipality views if result exist
Tschuppi81 May 6, 2026
c2a7ca8
Handle municipalities with dot, e.g. St. Gallen and cleanup
Tschuppi81 May 7, 2026
0211fe9
Fix test
Tschuppi81 May 7, 2026
c8969b3
Add cli command to clean out all votes and elections
Tschuppi81 May 7, 2026
8cf1628
Adds view tests for municipal and municipality
Tschuppi81 May 7, 2026
24f8d7e
Template enhancement and linter issue fixed
Tschuppi81 May 7, 2026
ed85bf0
Adds eCH xml files for unit tests
Tschuppi81 May 7, 2026
4c11c13
Merge branch 'master' into feature/ogc-3103-wab-communal-elections
Tschuppi81 May 7, 2026
153d084
Cleanup and add missing translation
Tschuppi81 May 8, 2026
5ba6afa
Merge branch 'master' into feature/ogc-3103-wab-communal-elections
Tschuppi81 May 8, 2026
8fc5240
Updating the archive now uses the long title
Tschuppi81 May 28, 2026
a181f87
Adjust link style to communal votes and elections
Tschuppi81 May 28, 2026
a044bf8
Adjust tests to new texts or long title
Tschuppi81 May 28, 2026
1575925
Set domain segment when importing election information
Tschuppi81 May 28, 2026
ebaaada
Show municipality for communal votes and elections in breadcrumbs and…
Tschuppi81 May 28, 2026
efc884c
Undo taking over all meta information from elections/votes, pick spec…
Tschuppi81 May 28, 2026
ccab4c2
Increase title in municipality view
Tschuppi81 May 28, 2026
578cefa
Merge branch 'master' into feature/ogc-3103-wab-communal-elections
Tschuppi81 May 28, 2026
27429ee
searching for items will consider the domain segment
Tschuppi81 May 28, 2026
cf17607
Adds municipalities to archive links
Tschuppi81 May 28, 2026
8c631f5
Adjust test after adding municipalities to archive links
Tschuppi81 May 28, 2026
607a94e
Adds a view for all communal results (date independent) and adds a li…
Tschuppi81 May 28, 2026
6a215cd
Adds ech0252 upload view
Tschuppi81 May 29, 2026
f249b92
Remove ech0252 from vote and election uploads, move test to ech uploa…
Tschuppi81 May 29, 2026
3c4ce24
Controls the gap between wrapped breadcrumpbs
Tschuppi81 May 29, 2026
c2961b5
Adjust tests
Tschuppi81 May 29, 2026
1e653f5
add ech format description and make it the first format entry
Tschuppi81 May 29, 2026
2a3b57e
Merge branch 'master' into feature/ogc-3103-wab-communal-elections
Tschuppi81 Jun 1, 2026
d3d8c48
Show archive download link only on root page
Tschuppi81 Jun 2, 2026
5826f4f
Don't show archive links in or views
Tschuppi81 Jun 2, 2026
118aab4
Reduce information for municipality views
Tschuppi81 Jun 2, 2026
2ae02e8
Merge branch 'master' into feature/ogc-3103-wab-communal-elections
Tschuppi81 Jun 2, 2026
10c7230
Merge branch 'master' into feature/ogc-3103-wab-communal-elections
Tschuppi81 Jun 3, 2026
e1ff031
Ensure umlaut is also sanitized and only show 5 colums of municipalit…
Tschuppi81 Jun 8, 2026
f728803
Reduce information for municipality votes and election
Tschuppi81 Jun 5, 2026
59fb46c
Merge branch 'master' into feature/ogc-3103-wab-communal-elections
Tschuppi81 Jun 8, 2026
d30045d
Prioritize short title over long title, empty test
Tschuppi81 Jun 12, 2026
f97a226
Ensure long title for votes, short title for elections
Tschuppi81 Jun 12, 2026
c692bd2
Show municipality above election/vote title
Tschuppi81 Jun 12, 2026
d02cad5
Correct ballot terminology in translations, and optimize translations
Tschuppi81 Jun 12, 2026
9b054fa
Show municipality for archive search
Tschuppi81 Jun 12, 2026
5a07320
Show all municipalities as a plain linked list, without results
Tschuppi81 Jun 12, 2026
debccc3
Add communal archive views for municipality-scoped views with breadcr…
Tschuppi81 Jun 12, 2026
4fb3e10
Adjust title for comunal results by municipality
Tschuppi81 Jun 15, 2026
38fc324
Show latest year results for municipality view (to limit results)
Tschuppi81 Jun 15, 2026
0f64092
Merge branch 'master' into feature/ogc-3103-wab-communal-elections
Tschuppi81 Jun 15, 2026
092d68c
Move logic from template to view, fix and extend tests
Tschuppi81 Jun 15, 2026
3d714d4
Rework to show all municipality links in 3 columns
Tschuppi81 Jun 18, 2026
31dffd1
Show short title for elections, except detail view
Tschuppi81 Jun 18, 2026
7ffdc8e
Merge branch 'master' into feature/ogc-3103-wab-communal-elections
Tschuppi81 Jun 18, 2026
a42518c
Show only municipalities of actual year
Tschuppi81 Jun 19, 2026
6b29318
Ajust tests
Tschuppi81 Jun 19, 2026
510b9da
Merge branch 'master' into feature/ogc-3103-wab-communal-elections
Tschuppi81 Jun 22, 2026
78920cd
Merge branch 'master' into feature/ogc-3103-wab-communal-elections
Tschuppi81 Jun 23, 2026
931854f
Ensure to use the display name to slug mapping lookup for municipalit…
Tschuppi81 Jun 23, 2026
8c40a37
Increase test coverage
Tschuppi81 Jun 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,5 @@ dump.rdb
.codebuddy/

.aider*

.DS_Store
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ install_requires =
xlrd
xlsxwriter!=3.2.4
xsdata!=23.5
xsdata-ech<0.4.0
xsdata-ech
yubico-client
zope.sqlalchemy

Expand Down
41 changes: 41 additions & 0 deletions src/onegov/election_day/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
from onegov.core.cli import pass_group_context
from onegov.core.sms_processor import SmsQueueProcessor
from onegov.election_day.collections import ArchivedResultCollection
from onegov.election_day.collections import ElectionCollection
from onegov.election_day.collections import ElectionCompoundCollection
from onegov.election_day.collections import VoteCollection
from onegov.election_day.models import ArchivedResult
from onegov.election_day.models import Subscriber
from onegov.election_day.utils import add_local_results
Expand Down Expand Up @@ -250,3 +253,41 @@ def migrate(request: ElectionDayRequest, app: ElectionDayApp) -> None:
click.echo(f'Migrated {count} subscribers')

return migrate


@cli.command('delete-elections-and-votes')
@click.option('--confirm', is_flag=True, default=False,
help='Required to actually delete.')
def delete_elections_and_votes(confirm: bool) -> Processor:
r""" Deletes all elections, election compounds, votes and archived results.

.. code-block:: bash

onegov-election-day --select '/onegov_election_day/sg' \
delete-elections-and-votes --confirm

"""

def delete(request: ElectionDayRequest, app: ElectionDayApp) -> None:
if not confirm:
click.secho(
'Dry run — pass --confirm to actually delete.', fg='yellow'
)
return

session = request.app.session()
click.secho(f'Deleting elections/votes for {app.schema}', fg='yellow')

for election in ElectionCollection(session).query():
session.delete(election)
for compound in ElectionCompoundCollection(session).query():
session.delete(compound)
for vote in VoteCollection(session).query():
session.delete(vote)
session.query(ArchivedResult).filter_by(
schema=session.info['schema']
).delete()

click.secho('Done.', fg='green')

return delete
12 changes: 12 additions & 0 deletions src/onegov/election_day/collections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

from onegov.election_day.collections.archived_results import \
ArchivedResultCollection
from onegov.election_day.collections.archived_results import \
AllMunicipalArchivedResultCollection
from onegov.election_day.collections.archived_results import \
MunicipalArchivedResultCollection
from onegov.election_day.collections.archived_results import \
MunicipalityArchivedResultCollection
from onegov.election_day.collections.archived_results import \
MunicipalityYearArchivedResultCollection
from onegov.election_day.collections.archived_results import \
SearchableArchivedResultCollection
from onegov.election_day.collections.ballots import BallotCollection
Expand Down Expand Up @@ -34,6 +42,10 @@
'ElectionCompoundCollection',
'EmailSubscriberCollection',
'ListCollection',
'AllMunicipalArchivedResultCollection',
'MunicipalArchivedResultCollection',
'MunicipalityArchivedResultCollection',
'MunicipalityYearArchivedResultCollection',
'NotificationCollection',
'ScreenCollection',
'SearchableArchivedResultCollection',
Expand Down
Loading