Edgewall Software

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#12690 closed defect (cantfix)

AttributeError: 'Environment' object has no attribute 'get_db_cnx'

Reported by: lukasz.matecki@… Owned by:
Priority: normal Milestone:
Component: notification Version: 1.2
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:


How to Reproduce

While doing a GET operation on /prefs/announcer, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'panel_id': u'announcer'}

User agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0

System Information

Trac 1.2
Babel 0.9.6
Genshi 0.6 (without speedups)
Pygments 1.6
Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)]
pytz 2011c
RPC 1.1.5
setuptools 29.0.1
Subversion 1.7.5 (r1336830)
jQuery 1.11.3
jQuery UI 1.11.4
jQuery Timepicker 1.5.5

Enabled Plugins

AllAttachments r14371
teamcityplugin 0.3.3
tracannouncer 1.0.dev0
tracfilelist 0.1
tracticketreferenceplugin 0.5.0
tracxmlrpc 1.1.5

Interface Customization

site-htdocs teamcity, viresco_00.jpg

Python Traceback

Traceback (most recent call last):
  File "c:\Python27\lib\site-packages\trac\web\main.py", line 613, in _dispatch_request
  File "c:\Python27\lib\site-packages\trac\web\main.py", line 253, in dispatch
    resp = chosen_handler.process_request(req)
  File "c:\Python27\lib\site-packages\trac\prefs\web_ui.py", line 109, in process_request
    chosen_provider.render_preference_panel(req, panel_id)
  File "build\bdist.win32\egg\announcer\pref.py", line 87, in render_preference_panel
    for name, label, template, data in self._get_boxes(req):
  File "build\bdist.win32\egg\announcer\pref.py", line 82, in _get_boxes
  File "build\bdist.win32\egg\announcer\resolvers.py", line 107, in render_announcement_preference_box
    specified = self.setting.get_user_setting(req.session.sid)[1] or ''
  File "build\bdist.win32\egg\announcer\util\settings.py", line 51, in get_user_setting
    db = self.env.get_db_cnx()
AttributeError: 'Environment' object has no attribute 'get_db_cnx'

Attachments (0)

Change History (4)

comment:1 by Christian Boos, 5 years ago

Resolution: cantfix
Status: newclosed

You're running tracannouncer 1.0.dev0 with Trac 1.2. Try to see if there's a version 1.2 for the TH:AnnouncerPlugin (trunk seems fine, see TH:r16129).

in reply to:  1 comment:2 by Ryan J Ollos, 5 years ago

Replying to Christian Boos:

You're running tracannouncer 1.0.dev0 with Trac 1.2. Try to see if there's a version 1.2 for the TH:AnnouncerPlugin (trunk seems fine, see TH:r16129).

I worded that commit message poorly (not the first time someone has interpreted that as "trunk supports 1.2 now"). The trunk will support 1.2, but more changes are needed.

You may not need AnnouncerPlugin with Trac 1.2 because several of the features were added to Trac.

comment:3 by lukasz.matecki@…, 5 years ago

Ok, thanks for the information. Acutally I was looking for a solution when html notifications display properly in Outlook (not the case for the current html notifications from htmlnotificationplugin). Yes, I know that this is Outlook limitation as it is not able to render certain html elements. But all other content that I receive looks fine so there must some workaround.


comment:4 by Ryan J Ollos, 5 years ago

For TracHtmlNotificationPlugin, the Genshi template is named htmlnotification_ticket.html: browser:trachtmlnotificationplugin/0.12/trachtmlnotification/templates/htmlnotification_ticket.html. If you create a modified version of the template you can place it in your environment or shared templates directory and it will be used by the plugin. See TracInterfaceCustomization#ProjectTemplates for more info.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.