mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
TUVoteInfo: generalize Quorum
SQLite does not support native DECIMAL columns, and for that reason, we had to switch to using Strings that can hold the data in the case we are using sqlite. This commit sets the TUVoteInfo model up in a generic way, that it always converts to string when setting Quorum (OK for DECIMAL) and always converts to float when getting Quorum. This way, we can treat TUVoteInfo.Quorum as the same thing everywhere. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
541c978ac4
commit
8c345a0448
2 changed files with 15 additions and 2 deletions
|
@ -39,7 +39,7 @@ def test_tu_voteinfo_creation():
|
|||
assert tu_voteinfo.User == user.Username
|
||||
assert tu_voteinfo.Submitted == ts
|
||||
assert tu_voteinfo.End == ts + 5
|
||||
assert float(tu_voteinfo.Quorum) == 0.5
|
||||
assert tu_voteinfo.Quorum == 0.5
|
||||
assert tu_voteinfo.Submitter == user
|
||||
assert tu_voteinfo.Yes == 0
|
||||
assert tu_voteinfo.No == 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue