baruwaproject / baruwa2

Baruwa 2.0
http://www.baruwa.org
GNU General Public License v3.0
21 stars 9 forks source link

paging through Accounts, Lists and Domains Broken #39

Closed nido009 closed 10 years ago

nido009 commented 10 years ago

Problem is related to empty first- and lastname. Fix is to add check for empty names in

baruwa/lib/misc.py, function def convert_acct_to_json(pages, orgid):

def mkdict(item): "Make it a dict" if item.account_type == 1: user_icon = 'imgs/user_admin.png' elif item.account_type == 2: user_icon = 'imgs/user_dadmin.png' else: user_icon = 'imgs/user.png'

   if item.firstname is None:
        item.firstname = ''
  if item.lastname is None:
     item.lastname = ''
    return dict(id=item.id,
            username=item.username,
            fullname=item.firstname + ' ' + item.lastname,
            email=item.email,
            statusimg='imgs/tick.png' if item.active else 'imgs/minus.png',
            userimg=user_icon,
        )
akissa commented 10 years ago

Enterprise is not affected by this issue, will back port a fix for the community edition soon

akissa commented 10 years ago

This is already fixed in git version.