dimagi / django-prbac

Other
139 stars 38 forks source link

Python3 str repr #48

Closed benrudolph closed 6 years ago

benrudolph commented 6 years ago

This makes assigning roles easier in the Admin panel. Currently in python3 only Role(<id>) is shown since __unicode__ is not called in python3. According to this: https://docs.djangoproject.com/en/1.10/topics/python3/#str-and-unicode-methods, this is the way you get it to work in both worlds. Works for me in python3, haven't tested in python2

@millerdev

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.03%) to 90.764% when pulling 28861519d7d33945016f56d1e53bd89fc2d6b5ee on benrudolph:br/py3-str into 07359d6f53e3366aeec1aa58030fa58ca0458128 on dimagi:master.