Modify

Opened 3 years ago

Last modified 21 months ago

#9206 new defect

[PATCH] AttributeError: 'XmppPreferencePanel' object has no attribute 'xmpp_format_setting'

Reported by: jun66j5 Owned by: hasienda
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords: i18n
Cc: rjollos, doki_pen Trac Release: 0.12

Description

I'm working Japanese translations for the AnnouncerPlugin. While working, the following error occurs when visiting /prefs/announcer page.

2011-09-25 20:53:43,117 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "/home/jun66j5/venv/trac-0.12/lib/python2.4/site-packages/trac/web/main.py", line 522, in _dispatch_request
    dispatcher.dispatch(req)
  File "/home/jun66j5/venv/trac-0.12/lib/python2.4/site-packages/trac/web/main.py", line 243, in dispatch
    resp = chosen_handler.process_request(req)
  File "/home/jun66j5/venv/trac-0.12/lib/python2.4/site-packages/trac/prefs/web_ui.py", line 77, in process_request
    template, data = chosen_provider.render_preference_panel(req, panel_id)
  File "/home/jun66j5/src/trac/announcerplugin/announcer/pref.py", line 92, in render_preference_panel
    for name, label, template, data in self._get_boxes(req):
  File "/home/jun66j5/src/trac/announcerplugin/announcer/pref.py", line 86, in _get_boxes
    yield ((boxname, boxlabel) +
  File "/home/jun66j5/src/trac/announcerplugin/announcer/distributors/xmppd.py", line 254, in render_announcement_preference_box
    self.xmpp_format_setting.default)
AttributeError: 'XmppPreferencePanel' object has no attribute 'xmpp_format_setting'

XmppDistributor module has xmpp_format_setting attrubute, I think that it should be as the following patch.

  • announcer/distributors/xmppd.py

    diff --git a/announcer/distributors/xmppd.py b/announcer/distributors/xmppd.py
    index 3cf9f3f..55ed788 100644
    a b class XmppPreferencePanel(Component): 
    251251        for realm in supported_realms: 
    252252            name = 'xmpp_format_%s'%realm 
    253253            settings[realm] = SubscriptionSetting(self.env, name, 
    254                 self.xmpp_format_setting.default) 
     254                XmppDistributor(self.env).xmpp_format_setting.default) 
    255255        if req.method == "POST": 
    256256            for realm, setting in settings.items(): 
    257257                name = 'xmpp_format_%s'%realm 

Attachments (0)

Change History (4)

comment:1 follow-up: Changed 3 years ago by hasienda

  • Cc doki_pen added; hasienda removed
  • Keywords i18n added
  • Owner changed from doki_pen to hasienda

Would you be so kind as to assign any i18n stuff directly to me, please?

I'll have to resolve it anyway, since I did the initial implementation, and I'm on the way to improve it within next few weeks due to suspected Trac 0.11 backwards-compatibility issues, that I found in similar code for AccountManagerPlugin before. Thank you for taking care.

comment:2 Changed 22 months ago by hasienda

(In [12192]) TracAnnouncer: Correct class association for xmpp_format_setting, refs #9206.

Thanks to Jun Omae for testing, report with clear explanation and the patch
itself. Sorry for taking so much time until applying your fix.

comment:3 in reply to: ↑ 1 Changed 22 months ago by jun66j5

Replying to hasienda:

Would you be so kind as to assign any i18n stuff directly to me, please?

Ok. I do so from next time.

comment:4 Changed 21 months ago by hasienda

  • Cc rjollos added

#7828 has been closed as a duplicate.

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.