From 68d195375ef37c6c275cb9e99f9a9f231bf7c4e1 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 15 Dec 2012 16:47:01 -0800 Subject: [PATCH] use member.getProperty('fullname') if member.fullname is an empty string. Not sure in what case this would happen, but it did happen in my site migration --- plone/app/discussion/browser/migration.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/plone/app/discussion/browser/migration.py b/plone/app/discussion/browser/migration.py index 30d285b..fa806d0 100644 --- a/plone/app/discussion/browser/migration.py +++ b/plone/app/discussion/browser/migration.py @@ -96,18 +96,20 @@ class View(BrowserView): comment.text = reply.cooked_text comment.mime_type = 'text/html' comment.creator = reply.Creator() - comment.author_username = reply.getProperty('author_username',reply.Creator()) + + try: + comment.author_username = reply.author_username + except AttributeError: + comment.author_username = reply.Creator() + member = mt.getMemberById(comment.author_username) if member: -# comment.author_name = member.get('fullname') comment.author_name = member.fullname -# import pdb; pdb.set_trace() - -# .get is overloaded into zope somewhere.. so it'snot getting reply.email -## email = reply.get('email') -## if email: -## comment.author_email = email + if not comment.author_name: + # In migrated site member.fullname ='' while member.getProperty('fullname') has the correct value + comment.author_name = member.getProperty('fullname') + try: comment.author_email = reply.email except AttributeError: