0002-add-support-for-dj1.8-to-rebase-fixup.patch
src/authentic2/forms/mixins.py | ||
---|---|---|
37 | 37 |
try: |
38 | 38 |
choices = field.choices |
39 | 39 |
except AttributeError: |
40 |
initial = field.widget.format_value(initial) |
|
40 |
try: |
|
41 |
initial = field.widget.format_value(initial) |
|
42 |
except AttributeError: |
|
43 |
try: |
|
44 |
# Django 1.8 |
|
45 |
initial = field.widget._format_value(initial) |
|
46 |
except AttributeError: |
|
47 |
# TextArea or CheckboxInput |
|
48 |
if isinstance(initial, bool): |
|
49 |
initial = _('Yes') if initial else _('No') |
|
50 |
pass |
|
41 | 51 |
else: |
42 | 52 |
for key, label in choices: |
43 | 53 |
if initial == key: |
44 |
- |