~sircmpwn/sr.ht-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH core.sr.ht] srht.Validation: Don't reject enums with 0 values

Details
Message ID
<20211021174004.28803-1-rymg19@gmail.com>
DKIM signature
missing
Download raw message
Patch: +1 -1
This breaks APIs that hard require enums whose values can be 0, e.g.
todo.sr.ht's TicketResolution.
---
 srht/validation.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srht/validation.py b/srht/validation.py
index 36e5ba3..0feecd5 100644
--- a/srht/validation.py
+++ b/srht/validation.py
@@ -132,7 +132,7 @@ class Validation:
        value = self.optional(name, None, cls)
        if not friendly_name:
            friendly_name = name
        if not isinstance(value, bool) and not value:
        if not isinstance(value, (bool, Enum)) and not value:
            self.error('{} is required'.format(friendly_name), field=name)
        return value

-- 
2.32.0

[core.sr.ht/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CF59S6W9QAXY.IO4OCXM3TOFL@cirno>
In-Reply-To
<20211021174004.28803-1-rymg19@gmail.com> (view parent)
DKIM signature
missing
Download raw message
core.sr.ht/patches: SUCCESS in 2m58s

[srht.Validation: Don't reject enums with 0 values][0] from [Ryan Gonzalez][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/25860
[1]: rymg19@gmail.com

✓ #612202 SUCCESS core.sr.ht/patches/debian.yml    https://builds.sr.ht/~sircmpwn/job/612202
✓ #612201 SUCCESS core.sr.ht/patches/archlinux.yml https://builds.sr.ht/~sircmpwn/job/612201
✓ #612200 SUCCESS core.sr.ht/patches/alpine.yml    https://builds.sr.ht/~sircmpwn/job/612200
Details
Message ID
<CF5PIWRHJIWW.KIIEJ2LX097H@taiga>
In-Reply-To
<20211021174004.28803-1-rymg19@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/core.sr.ht
   04703e6..0e24522  master -> master
Reply to thread Export thread (mbox)