mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add TUVoteInfo.is_running() method
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
07c4be0afb
commit
4927a61378
2 changed files with 21 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
import typing
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Column, ForeignKey, Integer
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
from sqlalchemy.orm import backref, relationship
|
||||
|
@ -85,3 +87,6 @@ class TUVoteInfo(Base):
|
|||
""" Customize getattr to floatify any fetched Quorum values. """
|
||||
attr = super().__getattribute__(key)
|
||||
return float(attr) if key == "Quorum" else attr
|
||||
|
||||
def is_running(self):
|
||||
return self.End > int(datetime.utcnow().timestamp())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue