File tree Expand file tree Collapse file tree 5 files changed +137
-119
lines changed
Expand file tree Collapse file tree 5 files changed +137
-119
lines changed Original file line number Diff line number Diff line change 11import os
22import sys
33
4- __version__ = "4.4.4dev1 "
4+ __version__ = "4.4.4dev2 "
55
66sys .path .append (os .path .split (os .path .realpath (__file__ ))[0 ])
77
Original file line number Diff line number Diff line change 55from typing import Union
66
77from lib .core .enums import AnnotationStatus
8+ from lib .core .enums import BaseTitledEnum
89from lib .core .enums import ClassTypeEnum
910from lib .core .enums import ProjectStatus
1011from lib .core .enums import ProjectType
@@ -32,7 +33,11 @@ class EnumMemberError(PydanticTypeError):
3233 code = "enum"
3334
3435 def __str__ (self ) -> str :
35- permitted = ", " .join (str (v .name ) for v in self .enum_values ) # type: ignore
36+ enum_values = list (self .enum_values ) # noqa
37+ if isinstance (enum_values [0 ], BaseTitledEnum ):
38+ permitted = ", " .join (str (v .name ) for v in enum_values ) # type: ignore
39+ else :
40+ permitted = ", " .join (str (v .value ) for v in enum_values ) # type: ignore
3641 return f"Available values are: { permitted } "
3742
3843
Original file line number Diff line number Diff line change @@ -121,8 +121,13 @@ def serialize(
121121 exclude : Set [str ] = None ,
122122 ):
123123
124- to_exclude = {"sync_status" : True , "unverified_users" : True ,
125- "classes" : {"__all__" : {"attribute_groups" : {"__all__" : {"is_multiselect" }}}}}
124+ to_exclude = {
125+ "sync_status" : True ,
126+ "unverified_users" : True ,
127+ "classes" : {
128+ "__all__" : {"attribute_groups" : {"__all__" : {"is_multiselect" }}}
129+ },
130+ }
126131 if exclude :
127132 for field in exclude :
128133 to_exclude [field ] = True
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ def __hash__(self):
9696 return hash (f"{ self .id } { self .type } { self .name } " )
9797
9898 class Config :
99- extra = Extra .ignore
99+ extra = Extra .allow
100100 json_encoders = {
101101 HexColor : lambda v : v .__root__ ,
102102 BaseTitledEnum : lambda v : v .value ,
You can’t perform that action at this time.
0 commit comments