Opened 16 years ago
Closed 7 years ago
#4895 closed defect (fixed)
[patch] AccountManagerPlugin + Trac 0.12 (no attribute smtp_server)
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | AccountManagerPlugin |
Severity: | normal | Keywords: | change notification |
Cc: | Kyle Spraggs, James Mills | Trac Release: | 0.11 |
Description
I'm aware that 0.12 isn't supported yet but the only feature that doesn't work is sending e-mails. I get the following:
AttributeError: 'AccountChangeNotification' object has no attribute 'smtp_server'
I'm a software engineer but have no experience with Python. If anyone could point me in the right direction I'm sure I could fix the issue.
Thanks,
SpiffyJr
Attachments (1)
Change History (19)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
Cc: | Kyle Spraggs added; anonymous removed |
---|
comment:3 Changed 16 years ago by
Cc: | James Mills added |
---|
comment:4 follow-up: 5 Changed 16 years ago by
It seems that NotifyEmail class from trac.notification has lost several properties and this Account Manager notification.py hasn't been changed yet.
As a very hotfix you can modify 149 line and exclude missing properties to:
self.env.log.info("Sending SMTP notification to %s" % (recipients))
This is something related to logging activities and I don't need that at beta build.
Second change will be to comment out
#self.server.sendmail(msg['From'], recipients, msgtext)
This is notification about account creation.
At lease these changes will allow you to use account manager without email notifications.
Going forward you can try to make the actual change from self.server.sendmail... to something like self.notify... etc.
comment:5 Changed 15 years ago by
Replying to bebugz@gmail.com:
This is notification about account creation.
At lease these changes will allow you to use account manager without email notifications.
Going forward you can try to make the actual change from self.server.sendmail... to something like self.notify... etc.
is there already a propper patch for this problem. so that notification works again ?
comment:7 Changed 15 years ago by
Here's a fix:
To notification.py, add at the beginning:
from trac.notification import NotificationSystem
and replace
self.server.sendmail(msg['From'], recipients, msgtext)
with
NotificationSystem(self.env).send_email(msg['From'], recipients, msgtext)
That seems to fix it.
comment:9 Changed 15 years ago by
In what SVN? As far as I can tell, it has not been commited to trac-hacks SVN...
I need it as well :)
Changed 15 years ago by
Attachment: | 0001-updates-notification.py-for-trac-0.12-compatibility.patch added |
---|
comment:10 follow-up: 13 Changed 15 years ago by
Keywords: | patch added |
---|---|
Summary: | AccountManagerPlugin + Trac 0.12 (no attribute smtp_server) → [patch] AccountManagerPlugin + Trac 0.12 (no attribute smtp_server) |
The attached patch fixes AccountManager for trac-0.12. I'm pretty sure this will break 0.11. AccountManager appears to work well in 0.12, with this patch, so maybe it's time for a 0.12 branch?
comment:11 Changed 15 years ago by
Owner: | changed from Matt Good to John Hampton |
---|---|
Status: | new → assigned |
comment:12 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:13 follow-up: 18 Changed 13 years ago by
Keywords: | change notification added; patch removed |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
Trac Release: | 0.12 → 0.11 |
Replying to doki_pen:
![...] I'm pretty sure this will break 0.11. AccountManager appears to work well in 0.12, with this patch, so maybe it's time for a 0.12 branch?
Bad news for me, since current code is still meant to be compatible with Trac 0.11, so I'll reopen this issue for the old Trac release, just as a reminder, to check this and possibly work towards a more compatible fix.
comment:14 Changed 13 years ago by
Owner: | changed from John Hampton to Steffen Hoffmann |
---|---|
Status: | reopened → new |
comment:16 Changed 13 years ago by
comment:17 Changed 8 years ago by
Owner: | Steffen Hoffmann deleted |
---|
comment:18 Changed 7 years ago by
Replying to Steffen Hoffmann:
Bad news for me, since current code is still meant to be compatible with Trac 0.11, so I'll reopen this issue for the old Trac release, just as a reminder, to check this and possibly work towards a more compatible fix.
Trac 0.11 is no longer supported.
comment:19 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Log output: