durusmail: quixote-users: Bug fix in dulcinea.ui.feedback
Bug fix in dulcinea.ui.feedback
2004-09-15
Matt Campbell (2 parts)
Bug fix in dulcinea.ui.feedback
Matt Campbell
2004-09-15
I just found a bug in dulcinea.ui.feedback.  If the user isn't logged
in, then "*no id*" is placed in the real name and email address fields
by default.  I'm attaching a patch which fixes this bug.

Matt
--- feedback.ptl.orig   2004-09-15 11:51:18.000000000 -0500
+++ feedback.ptl        2004-09-15 11:53:18.000000000 -0500
@@ -30,9 +30,14 @@
         form.add(StringWidget, "subject", self.get_query_subject(),
                  title="Subject", size=50)
         user = get_user()
-        form.add(StringWidget, "real_name", user and user.format_realname(),
+        if user:
+            realname = user.format_realname()
+            email = user.format_email()
+        else:
+            realname = email = None
+        form.add(StringWidget, "real_name", realname,
                  title="Your name", size=50)
-        form.add(StringWidget, "sender", user and user.get_email(),
+        form.add(StringWidget, "sender", email,
                  title="Your e-mail address", size=50,
                  required=True)
         form.add(TextWidget, "message", title="Message", rows=10, cols=65,
reply