Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#9452 closed defect (cantfix)

AttributeError: 'Ticket' object has no attribute 'is_writeable_field'

Reported by: lior Owned by:
Priority: low Milestone:
Component: general Version: 0.11.7
Severity: minor Keywords:
Cc: support@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When using the 'BatchModifyPlugin' to reset the Milestone on multiple tickets.

How to Reproduce

While doing a POST operation on /query, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'__FORM_TOKEN': u'b06ef247ce0b9094c8413414',
 'batchmod': u'Change tickets',
 'bmod_flag_comment': u'on',
 'bmod_flag_milestone': u'on',
 'bmod_modify_changetime': u'true',
 'bmod_value_comment': u'',
 'bmod_value_milestone': u'',
 'col': [u'id',
         u'summary',
         u'milestone',
         u'status',
         u'priority',
         u'component'],
 'group': u'component',
 'query_href': u'/trac/venotion/query?status=assigned&status=new&status=reopened&group=component&order=priority&col=id&col=summary&col=milestone&col=status&col=priority&col=component&milestone=%21&sprint=&type=bug',
 'selectedTickets': u'1143,1277,1113'}

User Agent was: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.70 Safari/533.4

System Information

Trac 0.11.7
Python 2.6.4 (r264, May 30 2010, 13:35:10)
[GCC 4.3.4]
setuptools 0.6
SQLite 3.6.22
pysqlite 2.4.1
Genshi 0.5.1
mod_python 3.3.1
Agilo 1.3.0.1-PRO
Pygments 1.3.1
Subversion 1.6.9 (r901367)
jQuery: 1.2.6

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/trac/web/main.py", line 450, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.6/site-packages/trac/web/main.py", line 176, in dispatch
    chosen_handler)
  File "/usr/lib/python2.6/site-packages/trac/web/main.py", line 296, in _pre_process_request
    chosen_handler = filter_.pre_process_request(req, chosen_handler)
  File "/var/trac/env/venotion/plugins/BatchModify-0.6.0_trac0.11-py2.6.egg/batchmod/web_ui.py", line 47, in pre_process_request
    self._batch_modify(req)
  File "/var/trac/env/venotion/plugins/BatchModify-0.6.0_trac0.11-py2.6.egg/batchmod/web_ui.py", line 94, in _batch_modify
    t.save_changes(req.authname, comment)
  File "/usr/lib/python2.6/site-packages/trac/ticket/model.py", line 299, in save_changes
    listener.ticket_changed(self, comment, author, old_values)
  File "/usr/lib/python2.6/site-packages/binary_agilo-1.3.0.1_PRO-py2.6.egg/agilo/scrum/burndown/changelistener.py", line 69, in ticket_changed
    current_sprint_name = self._current_sprint_name(ticket)
  File "/usr/lib/python2.6/site-packages/binary_agilo-1.3.0.1_PRO-py2.6.egg/agilo/scrum/burndown/changelistener.py", line 119, in _current_sprint_name
    return self._current_value(Key.SPRINT, ticket) or None
  File "/usr/lib/python2.6/site-packages/binary_agilo-1.3.0.1_PRO-py2.6.egg/agilo/scrum/burndown/changelistener.py", line 128, in _current_value
    if not ticket.is_writeable_field(fieldname) or not ticket[fieldname]:
AttributeError: 'Ticket' object has no attribute 'is_writeable_field'

Attachments (0)

Change History (5)

comment:1 by Remy Blank, 15 years ago

Cc: support@… added
Resolution: cantfix
Status: newclosed

comment:2 by Felix Schwarz, 15 years ago

Looks like the batch modification plugin is not compatible with Agilo. Please ask the author to use agilo.ticket.model.AgiloTicket instead of trac.model.ticket.Ticket when Agilo is loaded.

As a workaround you might want to try Agilo's CSV interface.

comment:3 by JL San Martin, 15 years ago

Hi,

I have the same problem, so I modified the plugin to be compatible with Agilo. Here is the patch:

8c8,11
< from trac.ticket import TicketSystem, Ticket
---
> #from trac.ticket import TicketSystem, Ticket
> from agilo.ticket.api import AgiloTicketSystem
> from agilo.ticket.model import AgiloTicket
>
69c72
<         for field in TicketSystem(self.env).get_ticket_fields():
---
>         for field in AgiloTicketSystem(self.env).get_ticket_fields():
83c86
<                 t = Ticket(self.env, int(id))
---
>                 t = AgiloTicket(self.env, int(id))
152c155
<         ticketSystem = TicketSystem(self.env)
---
>         ticketSystem = AgiloTicketSystem(self.env)

comment:4 by JL San Martin, 15 years ago

I forgot to mention the patch is for the web_iu.py of the BatchModifyPlugin.

comment:5 by trac.edgewall.org@…, 13 years ago

Entered as https://trac-hacks.org/ticket/9682 - should have been entered there

Modify Ticket

Change Properties
Set your email in Preferences
Action
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.