Edgewall Software

Ticket #8229: bugzilla2trac.diff

File bugzilla2trac.diff, 1.1 KB (added by maarten.ter.huurne@…, 3 years ago)
  • bugzilla2trac.py

    old new  
    532539        trac.db().commit() 
    533540 
    534541        c.execute("DELETE FROM attachment") 
    535         attachments_dir = os.path.join(os.path.normpath(trac.env.path), 
     542        attachments_dir = os.path.join(os.path.normpath(trac.env.path), 
    536543                                "attachments") 
    537544        # Straight from the Python documentation. 
    538545        for root, dirs, files in os.walk(attachments_dir, topdown=False): 
     
    902909            trac.addAttachment(author, a) 
    903910 
    904911    print "\n8. Importing users and passwords..." 
    905     if BZ_VERSION >= 2167: 
     912    if BZ_VERSION >= 2164: 
    906913        selectlogins = "SELECT login_name, cryptpassword FROM profiles"; 
    907914        if IGNORE_DISABLED_USERS: 
    908915            selectlogins = selectlogins + " WHERE disabledtext=''" 
    909916        mysql_cur.execute(selectlogins) 
    910917        users = mysql_cur.fetchall() 
     918    else: 
     919        users = () 
    911920    htpasswd = file("htpasswd", 'w') 
    912921    for user in users: 
    913922        if LOGIN_MAP.has_key(user['login_name']):