[Trac] Username vs. email

Daragh Fitzpatrick Daragh at UChicago.edu
Thu Jul 8 15:03:31 UTC 2004
I tried to do this in the code, but broke something else, and the ticket
returns a 404. I don't have the setup to debug it.

This is what I want to do in Notify.py:

Original:
def get_email_addresses(self, txt):
  import email.Utils
  emails = [x[1] for x in  email.Utils.getaddresses([str(txt)])]
  return filter(lambda x: x.find('@') > -1, emails)

--

Proposed change:
def get_email_addresses(self, txt):
  import email.Utils
  domain = self.env.get_config('notification', 'default_domain',
'localhost')
  emails = [x[1] for x in  email.Utils.getaddresses([str(txt)])]
  emails_with_domain = []
  for e in emails:
    if e.count('@') == 0:
      emails_with_domain.append(e + '@' + domain)
    else:
      emails_with_domain.append(e)
  return filter(lambda x: x.find('@') > -1, emails_with_domain)

--

Why won't it work? Is the filter really recessary?

Cheers,

          :D

--------------------------------------------------------------------
Daragh Fitzpatrick        Daragh at UChicago.edu         (773) 702-8976

Solutions Architect                      NSIT Administrative Systems
Renewal Projects and Architecture              University of Chicago
--------------------------------------------------------------------

-----Original Message-----
From: Cap Petschulat [mailto:cap at cdres.com] 
Sent: Thursday, July 08, 2004 12:41 PM
To: trac at bobcat.edgewall.com; Daragh at uchicago.edu
Subject: Re: [Trac] Username vs. email

I'm not aware of an option to do this, but I agree that something along
those lines would be useful. I raised some questions about the handling of
usernames and email addresses in my post
http://lists.edgewall.com/archive/trac/msg00412.html, but never received any
comments. I'd be happy to spend more time on this if it won't interfere with
work being done by others or if I get some helpful feedback. 

To accommodate your situation, I would ammend the proposal in my previous
message to allow for default email domains for authenticated users.

On Wed, 2004-07-07 at 10:53, Daragh Fitzpatrick wrote:
> Hi,
> 
> 	currently my users are logging in with their LDAP directory ID,
which 
> also happens to be (conincidence more than design, I'm sure!) the 
> first half of their local email addresses.
> 
> 	However, when a ticket is created, the @uchicago.edu is not appended

> to their usernames. Is there a config parameter for this that I'm
missing!?
> Thanks in advance.