From: Rob van der Linde Date: Thu, 1 Feb 2024 03:52:17 +0000 (+1300) Subject: netcmd: models: EnumField now also supports IntFlag X-Git-Tag: tdb-1.4.11~1831 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4595a1dae3767309458080bc9df6b9ac2b492041;p=thirdparty%2Fsamba.git netcmd: models: EnumField now also supports IntFlag Signed-off-by: Rob van der Linde Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/netcmd/domain/models/fields.py b/python/samba/netcmd/domain/models/fields.py index 0b7e1eb83e4..ceec9819119 100644 --- a/python/samba/netcmd/domain/models/fields.py +++ b/python/samba/netcmd/domain/models/fields.py @@ -20,7 +20,7 @@ # along with this program. If not, see . # -from enum import IntEnum +from enum import IntEnum, IntFlag import io from abc import ABCMeta, abstractmethod @@ -181,7 +181,7 @@ class EnumField(Field): Has a special case for IntEnum as the constructor only accepts int. """ - if issubclass(self.enum, IntEnum): + if issubclass(self.enum, (IntEnum, IntFlag)): return self.enum(int(str(value))) else: return self.enum(str(value))