This is an automated email from the ASF dual-hosted git repository.
gstein pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/steve.git
The following commit(s) were added to refs/heads/trunk by this push:
new 75aa59c Various linting fixes.
75aa59c is described below
commit 75aa59c567c620169ccc277722852652a1ee9cda
Author: Greg Stein <[email protected]>
AuthorDate: Tue Sep 30 15:18:14 2025 -0500
Various linting fixes.
- main.py: no need for outer asfquart import
- pages.py: "use" the ELECTION and OWNED variables
- election.py: insert AUTHZ into the database
- persondb.py: no need to import easydict
---
v3/server/main.py | 2 --
v3/server/pages.py | 8 ++++++--
v3/steve/election.py | 6 +++---
v3/steve/persondb.py | 3 +--
4 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/v3/server/main.py b/v3/server/main.py
index 4a326f9..00353b2 100755
--- a/v3/server/main.py
+++ b/v3/server/main.py
@@ -19,8 +19,6 @@
import logging
import pathlib
-import asfquart
-
_LOGGER = logging.getLogger(__name__)
DATE_FORMAT = '%m/%d %H:%M'
diff --git a/v3/server/pages.py b/v3/server/pages.py
index 14088dd..95e9a06 100644
--- a/v3/server/pages.py
+++ b/v3/server/pages.py
@@ -67,11 +67,15 @@ async def voter_page():
election = steve.election.Election.open_to_pid(DB_FNAME, 'gstein')
owned = steve.election.Election.owned_elections(DB_FNAME, 'gstein')
+ ### for now
+ election = [ edict(eid='123', title='test election') ]
+ owned = [ edict(eid='456', title='another', authz=None, closed=None) ]
+
result = await signin_info()
result.title = 'Voting'
- result.election = [ edict(eid='123', title='test election') ]
- result.owned = [ edict(eid='456', title='another', authz=None,
closed=None) ]
+ result.election = election
+ result.owned = owned
return result
diff --git a/v3/steve/election.py b/v3/steve/election.py
index 3b9bbe3..683689b 100644
--- a/v3/steve/election.py
+++ b/v3/steve/election.py
@@ -372,9 +372,9 @@ class Election:
while True:
eid = crypto.create_id()
try:
- conn.execute('INSERT INTO election (eid, title, owner_pid)'
- ' VALUES (?, ?, ?)',
- (eid, title, owner_pid,))
+ conn.execute('INSERT INTO election (eid, title, owner_pid,
authz)'
+ ' VALUES (?, ?, ?, ?)',
+ (eid, title, owner_pid, authz, ))
break
except sqlite3.IntegrityError:
_LOGGER.debug('EID conflict(!!) ... trying again.')
diff --git a/v3/steve/persondb.py b/v3/steve/persondb.py
index 4f9d7a5..160fc57 100644
--- a/v3/steve/persondb.py
+++ b/v3/steve/persondb.py
@@ -22,7 +22,6 @@
import pathlib
import asfpy.db
-import easydict
THIS_DIR = pathlib.Path(__file__).resolve().parent
QUERIES = THIS_DIR.parent / 'queries.yaml'
@@ -70,4 +69,4 @@ class PersonDB:
# Run the query to completion, and return the entire list of Persons.
self.q_person.perform()
- return list(self.q_person.fetchall())
+ return list(self.q_person.fetchall()) # asfpy.db.DB uses EasyDict