fix(api): cast string value to int enum (#2461)

This commit is contained in:
Jonas L 2023-03-15 22:19:04 +01:00 committed by GitHub
parent 0d3a56aaae
commit c7381a4f80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -78,7 +78,9 @@ class Preference(models.Model):
entries = dict(cls.site.values_list("key", "value"))
return StreamPreferences(
input_fade_transition=float(entries.get("default_transition_fade") or 0.0),
message_format=MessageFormatKind(entries.get("stream_label_format") or 0),
message_format=MessageFormatKind(
int(entries.get("stream_label_format") or 0)
),
message_offline=entries.get("off_air_meta") or "Offline",
)