~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/answers/browser/question.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-09-03 18:39:50 UTC
  • mfrom: (11497.1.1 question-title-0)
  • Revision ID: launchpad@pqm.canonical.com-20100903183950-iuh3d2bsvlkttyxz
[r=EdwinGrubbs][ui=none][bug 583623] Restrict the ask question
        summary field to 250 chracters.

Show diffs side-by-side

added added

removed removed

Lines of Context:
539
539
    # The fields displayed on the search page.
540
540
    search_field_names = ['language', 'title']
541
541
 
542
 
    custom_widget('title', TextWidget, displayWidth=40)
 
542
    custom_widget('title', TextWidget, displayWidth=40, displayMaxWidth=250)
543
543
 
544
544
    search_template = ViewPageTemplateFile(
545
545
        '../templates/question-add-search.pt')
601
601
        if 'title' not in data:
602
602
            self.setFieldError(
603
603
                'title', _('You must enter a summary of your problem.'))
 
604
        else:
 
605
            if len(data['title']) > 250:
 
606
                self.setFieldError(
 
607
                    'title', _('The summary cannot exceed 250 characters.'))
604
608
        if self.widgets.get('description'):
605
609
            if 'description' not in data:
606
610
                self.setFieldError(