Skip to content

Commit b5cc5c1

Browse files
committed
Fix: event_simiarity_days serializer
1 parent 196a1ca commit b5cc5c1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ravenpackapi/models/fields.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ def decimal_optional(value):
5252
return None
5353

5454

55+
def float_optional(value):
56+
if value is not None:
57+
return float(value)
58+
return None
59+
60+
5561
def int_optional(value):
5662
if value is not None:
5763
return int(value)
@@ -72,7 +78,7 @@ def int_optional(value):
7278
Field('event_relevance', decimal_optional, validators=[between_inclusive(0, 100)]),
7379

7480
Field('event_similarity_key', str_optional, validators=[length_is(32)]),
75-
Field('event_similarity_days', int_optional),
81+
Field('event_similarity_days', float_optional),
7682

7783
Field('topic', str_optional),
7884
Field('group', str_optional),

0 commit comments

Comments
 (0)