#13124 closed enhancement (fixed)
Use Trac 1.2 notification API
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | AccountManagerPlugin |
Severity: | normal | Keywords: | |
Cc: | lkraav, ralph.phd@… | Trac Release: |
Description (last modified by )
Discussed in comment:8:ticket:13074, AccountManagerPlugin should be modified to use the new notification API in Trac 1.2.
Attachments (2)
Change History (22)
comment:1 Changed 8 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 7 years ago by
Cc: | lkraav added |
---|
comment:3 Changed 7 years ago by
from trac.notification.compat import NotifyEmail
helped, but now more (templating?) incompatibilities appeared:
Python Traceback Most recent call last: File "/home/trac/src/trac-1.2.git/trac/web/main.py", line 639, in _dispatch_request dispatcher.dispatch(req) File "/home/trac/src/trac-1.2.git/trac/web/main.py", line 262, in dispatch method=method) File "/home/trac/src/trac-1.2.git/trac/web/chrome.py", line 1423, in render_template fragment, iterable, method) File "/home/trac/src/trac-1.2.git/trac/web/chrome.py", line 1482, in _render_jinja_template page = self.render_template_string(template, data, text) File "/home/trac/src/trac-1.2.git/trac/web/chrome.py", line 1652, in render_template_string string = template.render(data) File "/home/trac/trunk-2.7/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/home/trac/trunk-2.7/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/home/trac/src/trac-hacks.git/accountmanagerplugin/trunk/acct_mgr/templates/admin_accountsconfig.html", line 34, in top-level template code (idx == active and 'active') or None}" File "/home/trac/trunk-2.7/lib/python2.7/site-packages/jinja2/environment.py", line 430, in getattr return getattr(obj, attribute)
comment:4 Changed 7 years ago by
This plugin still has Genshi templates. Trac trunk now assumes Jinja templates by default. At some point these should all be ported to Jinja syntax (see trac:wiki:TracDev/PortingFromGenshiToJinja). During the transition triggering the legacy Genshi mode should also work. Mostly this happens automatically, but in some cases a small change in the plugin is required: For example this line would have to be changed to return 'admin_accountsconfig.html', data, None
. (see trac:wiki:TracDev/PortingFromGenshiToJinja#PanelProviders)
You should probably open a new ticket for this though.
comment:6 Changed 7 years ago by
More work is needed for Trac 1.3.2+ compatibility. Changes will be committed against this ticket.
Changed 5 years ago by
Attachment: | accountmanager-notification-update.diff added |
---|
Patch to the current trunk
comment:7 Changed 5 years ago by
I added a patch that switches over to the new Notification API, and it fixes #13312 in the process. This was written against Trac 1.3.6 and not tested against the API of 1.2. The minimum Trac version will probably have to be updated, I did not make any provisions to run on an older version of the Trac API.
comment:8 Changed 5 years ago by
Status: | new → accepted |
---|
comment:9 Changed 5 years ago by
#13606 closed as a duplicate. I will get this patch reviewed and committed soon.
comment:10 Changed 5 years ago by
Cc: | ralph.phd@… added |
---|
Adding myself to cc; thanks for looking into this.
comment:14 Changed 5 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
If you've selectively enabled AccountManager components, be sure to have acct_mgr.notification.* = enabled
with TracAccountManager 0.6dev.
If you find any issues with the latest changes, please comment here and I'll try to address them quickly.
I made a branch with Trac 1.0 support in r17494, but I don't plan to do any more work supporting Trac 1.0.
comment:19 follow-up: 20 Changed 4 years ago by
I found this issue via #13601 which was about the same "Warning" I am seeing in my log file:
Skipping "acct_mgr.opt.announcer.uid_chg = acct_mgr.opt.announcer.uid_chg [announcer]": DistributionNotFound: The 'TracAnnouncer; extra == "announcer"' distribution was not found and is required by the application
It is still not clear to me from reading the comments in this issue if I should be getting this warning and if not, how to get rid of it.
I am trying to resolve a more significant problem in my recently upgraded trac instance (0.12 -> 1.4.2 - currently being discussed in the Trac Users forum) but figured I should iron out any of these wrinkles in the log output before escalating my issue.
comment:20 Changed 4 years ago by
Replying to rhills@…:
I found this issue via #13601 which was about the same "Warning" I am seeing in my log file:
Skipping "acct_mgr.opt.announcer.uid_chg = acct_mgr.opt.announcer.uid_chg [announcer]": DistributionNotFound: The 'TracAnnouncer; extra == "announcer"' distribution was not found and is required by the application
It's fine since AnnouncerPlugin is not compatible with Trac 1.2 or later, so it can't be used even if installed. Otherwise, the message is just saying that AnnouncerPlugin is not installed so the optional component isn't available.
Does this ticket mean that AccountManagerPlugin admin panel will not show up with current trunk (1.3.3-dev)?