diff --git a/bitfield/forms.py b/bitfield/forms.py index bbb9031..e4ea6e8 100644 --- a/bitfield/forms.py +++ b/bitfield/forms.py @@ -9,14 +9,14 @@ def render(self, name, value, attrs=None, choices=()): if isinstance(value, BitHandler): value = [k for k, v in value if v] elif isinstance(value, int): - real_value=[] - div=2 - for (k,v) in self.choices: + real_value = [] + div = 2 + for (k, v) in self.choices: if value % div != 0: real_value.append(k) value -= (value % div) - div*=2 - value=real_value + div *= 2 + value = real_value return super(BitFieldCheckboxSelectMultiple, self).render( name, value, attrs=attrs, choices=enumerate(choices))