mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-23 13:36:35 +00:00
Use the dict.get
function instead
This commit is contained in:
parent
2e6f07652a
commit
9e13870e6f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user