#1774 Milestone causes unicode error on ticket view

unreleased
invalid
Wolf
sf-1 (616)
Tracker
nobody
2014-12-09
2011-03-22
No

E.g. https://sourceforge.net/p/dorncms/tickets/11/

The milestones editing page loads fine (the milestone appears to be blank), as does the ticket listing page.

Module /var/local/allura/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_form.html:11 in top-level template code
<<        <div class="grid-6">
               <label class="cr">Milestone:</label>
               {{widget.display_field_by_name('_milestone')|safe}}
             </div>
           {% endif %}
>>  {{widget.display_field_by_name('_milestone')|safe}}
Module forgetracker.widgets.ticket_form:35 in display_field_by_name
<<          field = self.fields[idx]
               ctx = self.context_for(field)
               display = field.display(**ctx)
               if ctx['errors'] and field.show_errors and not ignore_errors:
                   display = "%s<div class='error'>%s</div>" % (display, ctx['errors'])
>>  display = field.display(**ctx)
Module ew.widget:39 in display
<<      def display(self, **kw):
               from .render import File
               context = self.prepare_context(kw)
               with push_context(widget_context, widget=self):
                   if isinstance(self.template, basestring):
>>  context = self.prepare_context(kw)
Module ew.select:38 in prepare_context
<<          context['options'] = [
                   self._option_object_for(context['value'], o)
                   for o in options ]
               return context
>>  for o in options ]
Module ew.select:51 in _option_object_for
<<      def _option_object_for(self, value, option):
               option = super(SingleSelectField, self)._option_object_for(value, option)
               if option.html_value == value or (value is None and option.selected):
                   option.selected = True
>>  option = super(SingleSelectField, self)._option_object_for(value, option)
Module ew.select:45 in _option_object_for
<<              option = Option(label=unicode(option), py_value=unicode(option))
               if option.html_value is None:
                   option.html_value = self.validator.from_python(option.py_value, None)
               return option
>>  option.html_value = self.validator.from_python(option.py_value, None)
Module ew.validators:69 in from_python
<<      def from_python(self, value, state):
               str_version = super(UnicodeString, self).from_python(value, state)
               return unicode(str_version, self.outputEncoding)
>>  return unicode(str_version, self.outputEncoding)
TypeError: decoding Unicode is not supported

Discussion

  • Dave Brondsema

    Dave Brondsema - 2011-03-31
    • size: --> 1
     
  • Dave Brondsema

    Dave Brondsema - 2011-03-31

    Timebox it, write a test perhaps

     
  • Jenny Steele - 2011-03-31
    • assigned_to: Jenny Steele
    • component: General --> Tracker
     
  • Jenny Steele - 2011-03-31
    • status: open --> in-progress
     
  • Jenny Steele - 2011-04-01

    I wrote a test that shows unicode milestones working on js/1774

     
  • Jenny Steele - 2011-04-01
    • status: in-progress --> code-review
    • assigned_to: Jenny Steele --> Wolf
     
  • Wolf - 2011-04-04
    • status: code-review --> invalid
     

Log in to post a comment.