chore: backport #2461 (#2480)

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

c7381a4f80
This commit is contained in:
Jonas L 2023-03-23 17:42:54 +01:00 committed by GitHub
parent bc745617fb
commit ba2a1220a0
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",
)