~sircmpwn/sr.ht-dev

core.sr.ht: srht.Validation: Don't reject enums with 0 values v1 APPLIED

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

 1 files changed, 1 insertions(+), 1 deletions(-)
#612200 alpine.yml success
#612201 archlinux.yml success
#612202 debian.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/25860/mbox | git am -3
Learn more about email & git

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

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: 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]: mailto: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
Thanks!

To git@git.sr.ht:~sircmpwn/core.sr.ht
   04703e6..0e24522  master -> master