Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix broken Flickr Account list in Django Admin
Was getting an error while loading the Flickr Account list in Django Admin. Ended in: ``` File "/Users/phil/Projects/personal/django-ditto/devproject/venv/lib/python3.11/site-packages/django/contrib/admin/templatetags/admin_list.py", line 310, in __init__ super().__init__(*items) File "/Users/phil/Projects/personal/django-ditto/devproject/venv/lib/python3.11/site-packages/django/contrib/admin/templatetags/admin_list.py", line 231, in items_for_result result_repr = display_for_value(value, empty_value_display, boolean) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/phil/Projects/personal/django-ditto/devproject/venv/lib/python3.11/site-packages/django/contrib/admin/utils.py", line 461, in display_for_value return _boolean_icon(value) ^^^^^^^^^^^^^^^^^^^^ File "/Users/phil/Projects/personal/django-ditto/devproject/venv/lib/python3.11/site-packages/django/contrib/admin/templatetags/admin_list.py", line 182, in _boolean_icon "admin/img/icon-%s.svg" % {True: "yes", False: "no", None: "unknown"}[field_val] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ KeyError: '40fdeee308d1a21f' ``` It was because `ditto.flickr.models.Account.has_credentials()` was returning a string, not a boolean. The it turns out that the `self.assertTrue()` and `self.assertFalse()` tests weren't too picky about whether something was a boolean or not. Fixes #245
- Loading branch information