Skip to content

Commit b4ddf0c

Browse files
authored
#779 View decryption (#780)
* better error handling for view decryption * fix bug where you can't navigate to a decryption * fix ui glitch on election page
1 parent 5748b04 commit b4ddf0c

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

src/electionguard_gui/components/view_decryption_component.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,16 @@ def expose(self) -> None:
4646
eel.expose(self.join_decryption)
4747

4848
def watch_decryption(self, decryption_id: str) -> None:
49-
db = self._db_service.get_db()
50-
self._log.debug(f"watching decryption '{decryption_id}'")
51-
self._db_watcher_service.watch_database(
52-
db, decryption_id, self.on_decryption_changed
53-
)
49+
try:
50+
db = self._db_service.get_db()
51+
self._log.debug(f"watching decryption '{decryption_id}'")
52+
self._db_watcher_service.watch_database(
53+
db, decryption_id, self.on_decryption_changed
54+
)
55+
except Exception as e: # pylint: disable=broad-except
56+
self.handle_error(e)
57+
self._db_watcher_service.stop_watching()
58+
# no need to raise exception or return anything, we're in fire-and-forget mode here
5459

5560
def stop_watching_decryption(self) -> None:
5661
self._db_watcher_service.stop_watching()

src/electionguard_gui/models/election_dto.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def to_dict(self) -> dict[str, Any]:
8383
],
8484
"decryptions": [
8585
{
86+
"decryption_id": decryption["decryption_id"],
8687
"name": decryption["name"],
8788
"created_at": utc_to_str(decryption.get("created_at")),
8889
}

src/electionguard_gui/web/components/admin/view-election-component.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,23 +97,20 @@ export default {
9797
<th>Uploaded</th>
9898
<th>Location</th>
9999
<th>Ballot Count</th>
100-
<th></th>
101100
</tr>
102101
</thead>
103102
<tbody class="table-group-divider">
104103
<tr v-for="ballot_upload in election.ballot_uploads">
105104
<td>{{ballot_upload.created_at}}</td>
106105
<td>{{ballot_upload.location}}</td>
107106
<td>{{ballot_upload.ballot_count}}</td>
108-
<td></td>
109107
</tr>
110108
</tbody>
111109
<tfoot>
112110
<tr class="table-secondary">
113111
<td><em>Total</em></td>
114112
<td>&nbsp;</td>
115113
<td>{{ballotSum}}
116-
<td></td>
117114
</tr>
118115
</tfoot>
119116
</table>
@@ -135,14 +132,12 @@ export default {
135132
<tr>
136133
<th>Created</th>
137134
<th>Name</th>
138-
<th></th>
139135
</tr>
140136
</thead>
141137
<tbody class="table-group-divider">
142138
<tr v-for="decryption in election.decryptions">
143139
<td>{{decryption.created_at}}</td>
144140
<td><a :href="getViewDecryptionUrl(decryption.decryption_id)">{{decryption.name}}</a></td>
145-
<td></td>
146141
</tr>
147142
</tbody>
148143
</table>

0 commit comments

Comments
 (0)