tommikaikkonen / prettyprinter

Syntax-highlighting, declarative and composable pretty printer for Python 3.5+
https://prettyprinter.readthedocs.io
MIT License
336 stars 20 forks source link

Django field with choices shows incorrect display name #17

Closed tommikaikkonen closed 6 years ago

tommikaikkonen commented 6 years ago

This line should test for equality, not truthiness. Hence the display name for the first declared choice is displayed in the output, no matter what the choice value is.

https://github.com/tommikaikkonen/prettyprinter/blob/a59cca532fc353f22b61757b4130c75aa2c4fb42/prettyprinter/extras/django.py#L157

tommikaikkonen commented 6 years ago

Fixed in https://github.com/tommikaikkonen/prettyprinter/commit/20db47116bbaa2f0f8f9321e35d4517cc35e334c