Skip to content

Commit e6ea3a5

Browse files
Attempt to fix Python APIs 4
Signed-off-by: Lukasz Gryglicki <[email protected]>
1 parent 24483df commit e6ea3a5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cla-backend/cla/models/dynamo_models.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,10 +731,17 @@ class PatchedUnicodeSetAttribute(UnicodeSetAttribute):
731731
"""
732732
def get_value(self, value):
733733
# if self.attr_type not in value:
734+
if not value:
735+
return set()
734736
if self.attr_type == 'SS' and 'L' in value:
735737
value = {'SS':list(map(lambda x: x['S'], value['L']))}
736738
super(PatchedUnicodeSetAttribute, self).get_value(value)
737739

740+
def deserialize(self, value):
741+
if not value:
742+
return set()
743+
return set(value)
744+
738745
class BaseModel(Model):
739746
"""
740747
Base pynamodb model used for all CLA models.

0 commit comments

Comments
 (0)