Projet

Général

Profil

« Précédent | Suivant » 

Révision c18739db

Ajouté par Josué Kouka il y a plus de 8 ans

fix UnicodeEncodeError in UserCredentials Model

Voir les différences:

mandayejs/mandaye/models.py
14 14
# You should have received a copy of the GNU Affero General Public License
15 15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 16

  
17

  
17 18
from django.db import models
18 19
from jsonfield import JSONField
19 20
from django.utils.translation import ugettext_lazy as _
......
27 28
    class Meta:
28 29
        unique_together = ('user',)
29 30

  
30
    def __str__(self):
31
        return self.user.get_full_name() or self.user.email or self.user.username
31
    def __unicode__(self):
32
        return self.user.get_full_name() \
33
            or self.user.email \
34
            or self.user.username
32 35

  
33 36
    def to_login_info(self):
34 37
        return {'#'+k : v for k,v in self.locators.items() if k != 'csrfmiddlewaretoken' }

Formats disponibles : Unified diff