Modify

Opened 8 years ago

Closed 5 years ago

Last modified 4 years ago

#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 Ryan J Ollos)

Discussed in comment:8:ticket:13074, AccountManagerPlugin should be modified to use the new notification API in Trac 1.2.

Attachments (2)

accountmanager-notification-update.diff (12.1 KB) - added by Niels Sascha Reedijk 5 years ago.
Patch to the current trunk
notification.py (8.6 KB) - added by Niels Sascha Reedijk 5 years ago.
Complete new version of notification.py

Download all attachments as: .zip

Change History (22)

comment:1 Changed 8 years ago by Ryan J Ollos

Description: modified (diff)

comment:2 Changed 7 years ago by lkraav

Cc: lkraav added

Does this ticket mean that AccountManagerPlugin admin panel will not show up with current trunk (1.3.3-dev)?

comment:3 Changed 7 years ago by lkraav

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 Peter Suter

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:5 Changed 7 years ago by Ryan J Ollos

In 17051:

TracAccountManager 0.5dev: Make template args compatible with Trac 1.3.2+

Refs #13124.

comment:6 Changed 7 years ago by Ryan J Ollos

More work is needed for Trac 1.3.2+ compatibility. Changes will be committed against this ticket.

Last edited 7 years ago by Ryan J Ollos (previous) (diff)

Changed 5 years ago by Niels Sascha Reedijk

Patch to the current trunk

Changed 5 years ago by Niels Sascha Reedijk

Attachment: notification.py added

Complete new version of notification.py

comment:7 Changed 5 years ago by Niels Sascha Reedijk

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 Ryan J Ollos

Status: newaccepted

comment:9 Changed 5 years ago by Ryan J Ollos

#13606 closed as a duplicate. I will get this patch reviewed and committed soon.

comment:10 Changed 5 years ago by Ralph <ralph.phd@…>

Cc: ralph.phd@… added

Adding myself to cc; thanks for looking into this.

comment:11 Changed 5 years ago by Ryan J Ollos

In 17492:

TracAccountManager 0.5.1dev: Adapt to Trac 1.2 notification system

Refs #13312, #13124.

comment:12 Changed 5 years ago by Ryan J Ollos

In 17493:

TracAccountManager 0.5.1dev: Bump version requirement to Trac 1.2

Refs #13124.

comment:13 Changed 5 years ago by Ryan J Ollos

In 17495:

TracAccountManager 0.6dev: Bump trunk to version 0.6

The trunk only supports Trac >= 1.2 since r17492.

Refs #13312, #13124.

comment:14 Changed 5 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

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.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:15 Changed 5 years ago by Ryan J Ollos

#13610 closed as a duplicate.

comment:16 Changed 5 years ago by Ryan J Ollos

In 17506:

TracAccountManager 0.6dev: Refactor r17492

Refs #13312, #13124.

comment:17 Changed 5 years ago by Ryan J Ollos

In 17507:

TracAccountManager 0.6dev: Use [notification] smtp_subject_prefix

Refs #13124.

comment:18 Changed 5 years ago by figaro

#13620 closed as a duplicate.

comment:19 Changed 4 years ago by 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 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 in reply to:  19 Changed 4 years ago by Ryan J Ollos

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.