From 8082100b7ed10f85968a4e1a5d37ca3cbd18d021 Mon Sep 17 00:00:00 2001 From: Max Metz Date: Tue, 27 Aug 2024 20:33:33 +0200 Subject: [PATCH] using the @classmethod _missing_ function in an IntFlag creates an incorrect resolution of intflags. 127 was resolved as 0 due to the _missing_ function. Without that method, 127 becomes a proper multi-flag --- src/server/BreCal/database/enums.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/server/BreCal/database/enums.py b/src/server/BreCal/database/enums.py index 7cab2d0..04516fc 100644 --- a/src/server/BreCal/database/enums.py +++ b/src/server/BreCal/database/enums.py @@ -11,10 +11,6 @@ class ParticipantType(IntFlag): PORT_ADMINISTRATION = 32 TUG = 64 - @classmethod - def _missing_(cls, value): - return cls.undefined - class ShipcallType(IntEnum): """determines the type of a shipcall, as this changes the applicable validation rules""" undefined = 0 @@ -66,7 +62,3 @@ class ParticipantFlag(IntFlag): """ undefined = 0 BSMD = 1 - - @classmethod - def _missing_(cls, value): - return cls.undefined