Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#13939 closed defect (fixed)

Import 'ngettext' is missed

Reported by: Andrew G. Khodotov Owned by: Jun Omae
Priority: normal Component: AdvancedTicketWorkflowPlugin
Severity: major Keywords:
Cc: Trac Release: 1.2

Description

When I set "clear_fields" operation, I get "NameError: global name 'ngettext' is not defined" error. Quote from trace log:

  File "/home/and/.local/lib/python2.7/site-packages/advancedworkflow/controller.py", line 269, in render_ticket_action_control
    hint = ngettext("The %(fields)s field will be cleared.",

Need to append import section:

from trac.util.translation import domain_functions, ngettext

has solve.

Attachments (0)

Change History (4)

comment:1 Changed 3 years ago by Jun Omae

The use of ngettext is introduced in r16901 (#13237).

We should use ngettext from domain_functions() rather than importing from trac.util.translation.

  • advancedworkflow/controller.py

     
    2929from trac.web.chrome import Chrome, add_warning
    3030
    3131
    32 _, tag_, add_domain = domain_functions('advancedworkflow',
    33                                        '_', 'tag_', 'add_domain')
     32_, tag_, ngettext, add_domain = \
     33    domain_functions('advancedworkflow', '_', 'tag_', 'ngettext', 'add_domain')
    3434
    3535
    3636class TicketWorkflowOpBase(Component):

comment:2 Changed 3 years ago by Andrew G. Khodotov

Well, so be it. Please apply this patch to version in repository. 1.2.2.dev0 from https://trac-hacks.org/svn/advancedticketworkflowplugin/1.2/ has a bug.

comment:3 Changed 3 years ago by Ryan J Ollos

Owner: set to Ryan J Ollos
Resolution: fixed
Status: newclosed

In 17954:

TracAdvancedTicketWorkflow 1.2.2dev: Add missing import

Patch by Jun Omae.

Fixes #13939.

comment:4 Changed 3 years ago by Ryan J Ollos

Owner: changed from Ryan J Ollos to Jun Omae

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
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.