From 9e13870e6f3e63c54fc1bc048702e63a59020ef5 Mon Sep 17 00:00:00 2001 From: tcely Date: Sat, 17 May 2025 20:01:51 -0400 Subject: [PATCH] Use the `dict.get` function instead --- tubesync/sync/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tubesync/sync/fields.py b/tubesync/sync/fields.py index 648afc63..e489ff08 100644 --- a/tubesync/sync/fields.py +++ b/tubesync/sync/fields.py @@ -63,7 +63,7 @@ class CommaSepChoiceField(models.CharField): def __init__(self, *args, separator=",", possible_choices=(("","")), all_choice="", all_label="All", allow_all=False, **kwargs): kwargs.setdefault('max_length', 128) self.separator = str(separator) - self.possible_choices = possible_choices or kwargs['choices'] + self.possible_choices = possible_choices or kwargs.get('choices') self.selected_choices = list() self.allow_all = allow_all self.all_label = all_label