I'm trying to install Account Manager 0.6.dev0 on Ubuntu 18.04LTS with Trac
1.4.2. It installed properly (sudo -H pip install --pre TracAccountManager)
and comes up in Trac, but Notifications don't work. Notifications are set
to I get the following error:
2021-04-15 13:40:37,744 Trac[api] INFO: Email verification requested for
user: username
2021-04-15 13:40:37,749 Trac[mail] WARNING: EmailDistributor caught
exception while formatting account to text/plain for email: <class
'acct_mgr.notification.AccountNotificationFormatter'>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/trac/notification/mail.py",
line 487, in distribute
outputs[fmt] = formatter.format(transport, fmt, event)
File "/usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py",
line 171, in format
return self._format_body(data, template_name)
File "/usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py",
line 179, in _format_body
template = chrome.load_template(template_name, method='text')
TypeError: load_template() got an unexpected keyword argument 'method'
2021-04-15 13:40:37,749 Trac[mail] WARNING: EmailDistributor cannot send
event 'account' as 'text/plain': username@domain.com
[notification]
admit_domains =
ambiguous_char_width = single
batch_subject_template = ${prefix} Batch modify: ${tickets_descr}
default_format.email = text/html
email_address_resolvers = SessionEmailResolver
email_sender = SendmailEmailSender
ignore_domains =
message_id_hash = md5
mime_encoding = none
sendmail_path = /usr/sbin/ssmtp
smtp_always_bcc =
smtp_always_cc =
smtp_default_domain =
smtp_enabled = enabled
It was my understanding this error was fixed in 0.6.dev0 according to Changeset
17831 <https://trac-hacks.org/changeset/17831> but the lines in
/usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py do not
reflect the change shown in that Changeset.
def _format_body(self, data, template_name):
# 3 commented lines are replacements for when Trac < 1.4 is dropped
chrome = Chrome(self.env)
data = chrome.populate_data(None, data)
template = chrome.load_template(template_name, method='text')
#template = chrome.load_template(template_name, text=True)
t = deactivate() # don't translate the e-mail stream
try:
stream = template.generate(**data)
return stream.render('text', encoding='utf-8')
#body = chrome.render_template_string(template, data, text=True)
#return body.encode('utf-8')
except Exception as e:
self.log.error("Failed to format body of notification mail: %s",
exception_to_unicode(e, traceback=True))
finally:
reactivate(t)
So, I tried uninstalling 0.6.dev0 and downloading the wheel from
https://pypi.org/project/TracAccountManager/0.6.dev0/#modal-close and
installing from that using
sudo -H python -m pip install TracAccountManager-0.6.dev0-py2-none-any.whl
I used sudo so it would install in the python2.7/dist-packages directory,
however, it still shows the old lines in notifications.py.
What am I missing?
--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/96eda815-343b-4c6f-aa5c-7016d0010b22n%40googlegroups.com.
1.4.2. It installed properly (sudo -H pip install --pre TracAccountManager)
and comes up in Trac, but Notifications don't work. Notifications are set
to I get the following error:
2021-04-15 13:40:37,744 Trac[api] INFO: Email verification requested for
user: username
2021-04-15 13:40:37,749 Trac[mail] WARNING: EmailDistributor caught
exception while formatting account to text/plain for email: <class
'acct_mgr.notification.AccountNotificationFormatter'>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/trac/notification/mail.py",
line 487, in distribute
outputs[fmt] = formatter.format(transport, fmt, event)
File "/usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py",
line 171, in format
return self._format_body(data, template_name)
File "/usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py",
line 179, in _format_body
template = chrome.load_template(template_name, method='text')
TypeError: load_template() got an unexpected keyword argument 'method'
2021-04-15 13:40:37,749 Trac[mail] WARNING: EmailDistributor cannot send
event 'account' as 'text/plain': username@domain.com
[notification]
admit_domains =
ambiguous_char_width = single
batch_subject_template = ${prefix} Batch modify: ${tickets_descr}
default_format.email = text/html
email_address_resolvers = SessionEmailResolver
email_sender = SendmailEmailSender
ignore_domains =
message_id_hash = md5
mime_encoding = none
sendmail_path = /usr/sbin/ssmtp
smtp_always_bcc =
smtp_always_cc =
smtp_default_domain =
smtp_enabled = enabled
It was my understanding this error was fixed in 0.6.dev0 according to Changeset
17831 <https://trac-hacks.org/changeset/17831> but the lines in
/usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py do not
reflect the change shown in that Changeset.
def _format_body(self, data, template_name):
# 3 commented lines are replacements for when Trac < 1.4 is dropped
chrome = Chrome(self.env)
data = chrome.populate_data(None, data)
template = chrome.load_template(template_name, method='text')
#template = chrome.load_template(template_name, text=True)
t = deactivate() # don't translate the e-mail stream
try:
stream = template.generate(**data)
return stream.render('text', encoding='utf-8')
#body = chrome.render_template_string(template, data, text=True)
#return body.encode('utf-8')
except Exception as e:
self.log.error("Failed to format body of notification mail: %s",
exception_to_unicode(e, traceback=True))
finally:
reactivate(t)
So, I tried uninstalling 0.6.dev0 and downloading the wheel from
https://pypi.org/project/TracAccountManager/0.6.dev0/#modal-close and
installing from that using
sudo -H python -m pip install TracAccountManager-0.6.dev0-py2-none-any.whl
I used sudo so it would install in the python2.7/dist-packages directory,
however, it still shows the old lines in notifications.py.
What am I missing?
--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/96eda815-343b-4c6f-aa5c-7016d0010b22n%40googlegroups.com.