Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Commit

Permalink
Merge pull request #60 from fedora-infra/feature/typofix2
Browse files Browse the repository at this point in the history
Another typofix.
  • Loading branch information
ralphbean committed Mar 26, 2015
2 parents ab23025 + 6c1b6a0 commit b9dfff6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions fmn/consumer/backends/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

reason = u"""
You received this message due to your preference settings at
{base_url}/{user}/email/{filter_id}
{base_url}{user}/email/{filter_id}
"""


Expand Down Expand Up @@ -183,14 +183,14 @@ def handle_bad_email_address(self, session, recipient):
self.log.warning("Dealing with bad email %s, %s" % (address, user))
pref = self.preference_for(session, address)
if address.endswith('@fedoraproject.org'):
fas_email = get_fas_email(user, **self.config)
fas_email = get_fas_email(self.config, user)
self.log.info("Got fas email as %r " % fas_email)
if fas_email != address:
pref.delete_details(address)
pref.update_details(fas_email)
pref.delete_details(session, address)
pref.update_details(session, fas_email)
else:
self.log.warning("Disabling %s for good..." % user)
pref.disable()
pref.set_enabled(session, False)
else:
self.log.warning("Disabling %s for good..." % user)
pref.disable()
pref.set_enabled(session, False)
4 changes: 2 additions & 2 deletions fmn/consumer/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def get_fas_email(config, username):
try:
fas = fedora.client.AccountSystem(**config['fas_credentials'])
person = fas.person_by_username(username)
if person.email:
return person.email
if person.get('email'):
return person['email']
raise ValueError("No email found: %r, %r" % (person.email, username))
except Exception:
log.exception("Failed to get FAS email for %r" % username)
Expand Down

0 comments on commit b9dfff6

Please sign in to comment.